home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_sh-utils.idb / usr / freeware / info / sh-utils.info.z / sh-utils.info
Encoding:
GNU Info File  |  1998-05-21  |  122.9 KB  |  3,461 lines

  1. This is Info file sh-utils.info, produced by Makeinfo version 1.67 from
  2. the input file sh-utils.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Shell utilities: (sh-utils).          GNU shell utilities.
  6. * basename: (sh-utils)basename invocation.      Strip directory and suffix.
  7. * chroot: (sh-utils)chroot invocation.          Specify the root directory.
  8. * date: (sh-utils)date invocation.              Print/set system date and time.
  9. * dirname: (sh-utils)dirname invocation.        Strip non-directory suffix.
  10. * echo: (sh-utils)echo invocation.              Print a line of text.
  11. * env: (sh-utils)env invocation.                Modify the environment.
  12. * expr: (sh-utils)expr invocation.              Evaluate expressions.
  13. * factor: (sh-utils)factor invocation.          Print prime factors
  14. * false: (sh-utils)false invocation.            Do nothing, unsuccessfully.
  15. * groups: (sh-utils)groups invocation.          Print group names a user is in.
  16. * hostname: (sh-utils)hostname invocation.      Print or set system name.
  17. * id: (sh-utils)id invocation.                  Print real/effective uid/gid.
  18. * logname: (sh-utils)logname invocation.        Print current login name.
  19. * nice: (sh-utils)nice invocation.              Modify scheduling priority.
  20. * nohup: (sh-utils)nohup invocation.            Immunize to hangups.
  21. * pathchk: (sh-utils)pathchk invocation.        Check file name portability.
  22. * printenv: (sh-utils)printenv invocation.      Print environment variables.
  23. * printf: (sh-utils)printf invocation.          Format and print data.
  24. * pwd: (sh-utils)pwd invocation.                Print working directory.
  25. * seq: (sh-utils)seq invocation.                Print numeric sequences
  26. * sleep: (sh-utils)sleep invocation.            Delay for a specified time.
  27. * stty: (sh-utils)stty invocation.              Print/change terminal settings.
  28. * su: (sh-utils)su invocation.                  Modify user and group id.
  29. * tee: (sh-utils)tee invocation.                Redirect to multiple files.
  30. * test: (sh-utils)test invocation.              File/string tests.
  31. * true: (sh-utils)true invocation.              Do nothing, successfully.
  32. * tty: (sh-utils)tty invocation.                Print terminal name.
  33. * uname: (sh-utils)uname invocation.            Print system information.
  34. * users: (sh-utils)users invocation.            Print current user names.
  35. * who: (sh-utils)who invocation.                Print who is logged in.
  36. * whoami: (sh-utils)whoami invocation.          Print effective user id.
  37. * yes: (sh-utils)yes invocation.                Print a string indefinitely.
  38. END-INFO-DIR-ENTRY
  39.  
  40.    This file documents the GNU shell utilities.
  41.  
  42.    Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
  43.  
  44.    Permission is granted to make and distribute verbatim copies of this
  45. manual provided the copyright notice and this permission notice are
  46. preserved on all copies.
  47.  
  48.    Permission is granted to copy and distribute modified versions of
  49. this manual under the conditions for verbatim copying, provided that
  50. the entire resulting derived work is distributed under the terms of a
  51. permission notice identical to this one.
  52.  
  53.    Permission is granted to copy and distribute translations of this
  54. manual into another language, under the above conditions for modified
  55. versions, except that this permission notice may be stated in a
  56. translation approved by the Foundation.
  57.  
  58. 
  59. File: sh-utils.info,  Node: Top,  Next: Introduction,  Up: (dir)
  60.  
  61. GNU shell utilities
  62. *******************
  63.  
  64.    This manual minimally documents version 1.16b of the GNU shell
  65. utilities.
  66.  
  67. * Menu:
  68.  
  69. * Introduction::                Caveats, overview, and authors.
  70. * Common options::              Common options.
  71.  
  72. * Date input formats::          Specifying date strings.
  73. * Printing text::               echo printf yes
  74. * Conditions::                  false true test expr
  75. * Redirection::                 tee
  76. * File name manipulation::      dirname basename pathchk
  77. * Working context::             pwd stty printenv tty
  78. * User information::            id logname whoami groups users who
  79. * System context::              date uname hostname
  80. * Modified command invocation:: chroot env nice nohup su
  81. * Delaying::                    sleep
  82. * Numeric operations::          factor seq
  83.  
  84. * Index::                       General index.
  85.  
  86. 
  87. File: sh-utils.info,  Node: Introduction,  Next: Common options,  Prev: Top,  Up: Top
  88.  
  89. Introduction
  90. ************
  91.  
  92.    First of all, this manual is incomplete.  The `stty' section, in
  93. particular, needs substantial reorganization and additional explanatory
  94. text before it will be up to the standard of other GNU manuals.
  95. Explanatory text in general is lacking; the manual presently assumes you
  96. pretty much know what to do, and just need to be reminded of how.  Thus,
  97. if you are interested, please get involved in improving this manual.
  98. The entire GNU community will benefit.
  99.  
  100.    Some of these programs are useful only when writing shell scripts;
  101. utilities like these are, in fact, the "language" of shell scripts (to
  102. a great extent).  Others are occasionally useful interactively.
  103.  
  104.    The GNU shell utilities are mostly compatible with the POSIX.2
  105. standard.
  106.  
  107.    Please report bugs to `sh-utils-bugs@gnu.ai.mit.edu'.  Remember to
  108. include the version number, machine architecture, input files, and any
  109. other information needed to reproduce the bug: your input, what you
  110. expected, what you got, and why it is wrong.  Diffs are welcome, but
  111. please include a description of the problem as well, since this is
  112. sometimes difficult to infer. *Note Bugs: (gcc)Bugs.
  113.  
  114.    This manual was originally derived from the Unix man pages in the
  115. distribution, which were written by David MacKenzie and updated by Jim
  116. Meyering.  What you are reading now is the authoritative documentation
  117. for these utilities;  the man pages are no longer being maintained.
  118. Franc,ois Pinard did the initial conversion to Texinfo format.  Karl
  119. Berry did the indexing, some reorganization, and editing of the results.
  120. Richard Stallman contributed his usual invaluable insights to the
  121. overall process.
  122.  
  123. 
  124. File: sh-utils.info,  Node: Common options,  Next: Date input formats,  Prev: Introduction,  Up: Top
  125.  
  126. Common options
  127. **************
  128.  
  129.    Certain options are available in all these programs.  Rather than
  130. writing identical descriptions for each of the programs, they are
  131. described here.  (In fact, every GNU program accepts (or should accept)
  132. these options.)
  133.  
  134.    Many of these programs take arbitrary strings as arguments.  In those
  135. cases, `--help' and `--version' are taken as these options only if
  136. there is one and exactly one command line argument.
  137.  
  138. `--help'
  139.      Print a usage message listing all available options, then exit
  140.      successfully.
  141.  
  142. `--version'
  143.      Print the version number, then exit successfully.
  144.  
  145. 
  146. File: sh-utils.info,  Node: Date input formats,  Next: Printing text,  Prev: Common options,  Up: Top
  147.  
  148. Date input formats
  149. ******************
  150.  
  151.      Our units of temporal measurement, from seconds on up to months,
  152.      are so complicated, asymmetrical and disjunctive so as to make
  153.      coherent mental reckoning in time all but impossible.  Indeed, had
  154.      some tyrannical god contrived to enslave our minds to time, to
  155.      make it all but impossible for us to escape subjection to sodden
  156.      routines and unpleasant surprises, he could hardly have done
  157.      better than handing down our present system.  It is like a set of
  158.      trapezoidal building blocks, with no vertical or horizontal
  159.      surfaces, like a language in which the simplest thought demands
  160.      ornate constructions, useless particles and lengthy
  161.      circumlocutions.  Unlike the more successful patterns of language
  162.      and science, which enable us to face experience boldly or at least
  163.      level-headedly, our system of temporal calculation silently and
  164.      persistently encourages our terror of time.
  165.  
  166.      ...  It is as though architects had to measure length in feet,
  167.      width in meters and height in ells; as though basic instruction
  168.      manuals demanded a knowledge of five different languages.  It is
  169.      no wonder then that we often look into our own immediate past or
  170.      future, last Tuesday or a week from Sunday, with feelings of
  171.      helpless confusion.  ...
  172.  
  173.      -- Robert Grudin, `Time and the Art of Living'.
  174.  
  175.    This section describes the textual date representations that GNU
  176. programs accept.  These are the strings you, as a user, can supply as
  177. arguments to the various programs.  The C interface (via the `getdate'
  178. function) is not described here.
  179.  
  180.    Although the date syntax here can represent any possible time since
  181. zero A.D., computer integers are not big enough for such a
  182. (comparatively) long time.  The earliest date semantically allowed on
  183. Unix systems is midnight, 1 January 1970 UCT.
  184.  
  185. * Menu:
  186.  
  187. * General date syntax::            Common rules.
  188. * Calendar date item::             19 Dec 1994.
  189. * Time of day item::               9:20pm.
  190. * Timezone item::                  EST, DST, BST, UCT, HAST, ...
  191. * Day of week item::               Monday and others.
  192. * Relative item in date strings::  next tuesday, 2 years ago.
  193. * Pure numbers in date strings::   19931219, 1440.
  194. * Authors of getdate::             Bellovin, Salz, Berets, et al.
  195.  
  196. 
  197. File: sh-utils.info,  Node: General date syntax,  Next: Calendar date item,  Up: Date input formats
  198.  
  199. General date syntax
  200. ===================
  201.  
  202.    A "date" is a string, possibly empty, containing many items
  203. separated by whitespace.  The whitespace may be omitted when no
  204. ambiguity arises.  The empty string means the beginning of today (i.e.,
  205. midnight).  Order of the items is immaterial.  A date string may contain
  206. many flavors of items:
  207.  
  208.    * calendar date items
  209.  
  210.    * time of the day items
  211.  
  212.    * time zone items
  213.  
  214.    * day of the week items
  215.  
  216.    * relative items
  217.  
  218.    * pure numbers.
  219.  
  220. We describe each of these item types in turn, below.
  221.  
  222.    A few numbers may be written out in words in most contexts.  This is
  223. most useful for specifying day of the week items or relative items (see
  224. below).  Here is the list: `first' for 1, `next' for 2, `third' for 3,
  225. `fourth' for 4, `fifth' for 5, `sixth' for 6, `seventh' for 7, `eighth'
  226. for 8, `ninth' for 9, `tenth' for 10, `eleventh' for 11 and `twelfth'
  227. for 12.  Also, `last' means exactly -1.
  228.  
  229.    When a month is written this way, it is still considered to be
  230. written numerically, instead of being "spelled in full"; this changes
  231. the allowed strings.
  232.  
  233.    Alphabetic case is completely ignored in dates.  Comments may be
  234. introduced between round parentheses, as long as included parentheses
  235. are properly nested.  Hyphens not followed by a digit are currently
  236. ignored.  Leading zeros on numbers are ignored.
  237.  
  238. 
  239. File: sh-utils.info,  Node: Calendar date item,  Next: Time of day item,  Prev: General date syntax,  Up: Date input formats
  240.  
  241. Calendar date item
  242. ==================
  243.  
  244.    A "calendar date item" specifies a day of the year.  It is specified
  245. differently, depending on whether the month is specified numerically or
  246. literally.  All these strings specify the same calendar date:
  247.  
  248.      1970-09-17           # ISO 8601.
  249.      70-9-17              # This century assumed by default.
  250.      70-09-17             # Leading zeros are ignored.
  251.      9/17/72              # Common U.S. writing.
  252.      24 September 1972
  253.      24 Sept 72           # September has a special abbreviation.
  254.      24 Sep 72            # Three-letter abbreviations always allowed.
  255.      Sep 24, 1972
  256.      24-sep-72
  257.      24sep72
  258.  
  259.    The year can also be omitted.  In this case, the last specified year
  260. is used, or the current year if none.  For example:
  261.  
  262.      9/17
  263.      sep 17
  264.  
  265.    Here are the rules.
  266.  
  267.    For numeric months, the ISO 8601 format `YEAR-MONTH-DAY' is allowed,
  268. where YEAR is any positive number, MONTH is a number between 01 and 12,
  269. and DAY is a number between 01 and 31.  A leading zero must be present
  270. if a number is less than ten.  If YEAR is less than 100, then 1900 is
  271. added to it to force a date in this century.  The construct
  272. `MONTH/DAY/YEAR', popular in the United States, is accepted.  Also
  273. `MONTH/DAY', omitting the year.
  274.  
  275.    Literal months may be spelled out in full: `January', `February',
  276. `March', `April', `May', `June', `July', `August', `September',
  277. `October', `November' or `December'.  Literal months may be abbreviated
  278. to their first three letters, possibly followed by an abbreviating dot.
  279. It is also permitted to write `Sept' instead of `September'.
  280.  
  281.    When months are written literally, the calendar date may be given as
  282. any of the following:
  283.  
  284.      DAY MONTH YEAR
  285.      DAY MONTH
  286.      MONTH DAY YEAR
  287.      DAY-MONTH-YEAR
  288.  
  289.    Or, omitting the year:
  290.  
  291.      MONTH DAY
  292.  
  293. 
  294. File: sh-utils.info,  Node: Time of day item,  Next: Timezone item,  Prev: Calendar date item,  Up: Date input formats
  295.  
  296. Time of day item
  297. ================
  298.  
  299.    A "time of day item" in date strings specifies the time on a given
  300. day.  Here are some examples, all of which represent the same time:
  301.  
  302.      20:02:0
  303.      20:02
  304.      8:02pm
  305.      20:02-0500      # In EST (Eastern U.S. Standard Time).
  306.  
  307.    More generally, the time of the day may be given as
  308. `HOUR:MINUTE:SECOND', where HOUR is a number between 0 and 23, MINUTE
  309. is a number between 0 and 59, and SECOND is a number between 0 and 59.
  310. Alternatively, `:SECOND' can be omitted, in which case it is taken to
  311. be zero.
  312.  
  313.    If the time is followed by `am' or `pm' (or `a.m.' or `p.m.'), HOUR
  314. is restricted to run from 1 to 12, and `:MINUTE' may be omitted (taken
  315. to be zero).  `am' indicates the first half of the day, `pm' indicates
  316. the second half of the day.  In this notation, 12 is the predecessor of
  317. 1: midnight is `12am' while noon is `12pm'.
  318.  
  319.    The time may alternatively be followed by a timezone correction,
  320. expressed as `SHHMM', where S is `+' or `-', HH is a number of zone
  321. hours and MM is a number of zone minutes.  When a timezone correction
  322. is given this way, it forces interpretation of the time in UTC,
  323. overriding any previous specification for the timezone or the local
  324. timezone.  The MINUTE part of the time of the day may not be elided
  325. when a timezone correction is used.  This is the only way to specify a
  326. timezone correction by fractional parts of an hour.
  327.  
  328.    Either `am'/`pm' or a timezone correction may be specified, but not
  329. both.
  330.  
  331. 
  332. File: sh-utils.info,  Node: Timezone item,  Next: Day of week item,  Prev: Time of day item,  Up: Date input formats
  333.  
  334. Timezone item
  335. =============
  336.  
  337.    A "timezone item" specifies an international timezone, indicated by
  338. a small set of letters.  Any included period is ignored.  Military
  339. timezone designations use a single letter.  Currently, only integral
  340. zone hours may be represented in a timezone item.  See the previous
  341. section for a finer control over the timezone correction.
  342.  
  343.    Here are many non-daylight-savings-time timezones, indexed by the
  344. zone hour value.
  345.  
  346. +000
  347.      `GMT' for Greenwich Mean, `UT' or `UTC' for Universal
  348.      (Coordinated), `WET' for Western European and `Z' for militaries.
  349.  
  350. +100
  351.      `WAT' for West Africa and `A' for militaries.
  352.  
  353. +200
  354.      `AT' for Azores and `B' for militaries.
  355.  
  356. +300
  357.      `C' for militaries.
  358.  
  359. +400
  360.      `AST' for Atlantic Standard and `D' for militaries.
  361.  
  362. +500
  363.      `E' for militaries and `EST' for Eastern Standard.
  364.  
  365. +600
  366.      `CST' for Central Standard and `F' for militaries.
  367.  
  368. +700
  369.      `G' for militaries and `MST' for Mountain Standard.
  370.  
  371. +800
  372.      `H' for militaries and `PST' for Pacific Standard.
  373.  
  374. +900
  375.      `I' for militaries and `YST' for Yukon Standard.
  376.  
  377. +1000
  378.      `HAST' for Hawaii-Aleutian Standard, `CAT' for Central Alaska,
  379.      `HST' for Hawaii Standard and `K' for militaries.
  380.  
  381. +1100
  382.      `L' for militaries and `NT' for Nome.
  383.  
  384. +1200
  385.      `IDLW' for International Date Line West and `M' for militaries.
  386.  
  387. -100
  388.      `CET' for Central European, `FWT' for French Winter, `MET' for
  389.      Middle European, `MEWT' for Middle European Winter, `N' for
  390.      militaries and `SWT' for Swedish Winter.
  391.  
  392. -200
  393.      `EET' for Eastern European, USSR Zone 1 and `O' for militaries.
  394.  
  395. -300
  396.      `BT' for Baghdad, USSR Zone 2 and `P' for militaries.
  397.  
  398. -400
  399.      `Q' for militaries and `ZP4' for USSR Zone 3.
  400.  
  401. -500
  402.      `R' for militaries and `ZP5' for USSR Zone 4.
  403.  
  404. -600
  405.      `S' for militaries and `ZP6' for USSR Zone 5.
  406.  
  407. -700
  408.      `T' for militaries and `WAST' for West Australian Standard.
  409.  
  410. -800
  411.      `CCT' for China Coast, USSR Zone 7 and `U' for militaries.
  412.  
  413. -900
  414.      `JST' for Japan Standard, USSR Zone 8 and `V' for militaries.
  415.  
  416. -1000
  417.      `EAST' for East Australian Standard, `GST' for Guam Standard, USSR
  418.      Zone 9 and `W' for militaries.
  419.  
  420. -1100
  421.      `X' for militaries.
  422.  
  423. -1200
  424.      `IDLE' for International Date Line East, `NZST' for New Zealand
  425.      Standard, `NZT' for New Zealand and `Y' for militaries.
  426.  
  427.    Here are many DST timezones, indexed by the zone hour value.  Also,
  428. by following a non-DST timezone by the string `DST' in a separate word
  429. (that is, separated by some whitespace), the corresponding DST timezone
  430. may be specified.
  431.  
  432. 0
  433.      `BST' for British Summer.
  434.  
  435. +400
  436.      `ADT' for Atlantic Daylight.
  437.  
  438. +500
  439.      `EDT' for Eastern Daylight.
  440.  
  441. +600
  442.      `CDT' for Central Daylight.
  443.  
  444. +700
  445.      `MDT' for Mountain Daylight.
  446.  
  447. +800
  448.      `PDT' for Pacific Daylight.
  449.  
  450. +900
  451.      `YDT' for Yukon Daylight.
  452.  
  453. -100
  454.      `MEST' for Middle European Summer, `MESZ' for Middle European
  455.      Summer, `SST' for Swedish Summer and `FST' for French Summer.
  456.  
  457. -700
  458.      `WADT' for West Australian Daylight.
  459.  
  460. -1000
  461.      `EADT' for Eastern Australian Daylight.
  462.  
  463. -1200
  464.      `NZDT' for New Zealand Daylight.
  465.  
  466. 
  467. File: sh-utils.info,  Node: Day of week item,  Next: Relative item in date strings,  Prev: Timezone item,  Up: Date input formats
  468.  
  469. Day of week item
  470. ================
  471.  
  472.    The explicit mention of a day of the week will forward the date
  473. (only if necessary) to reach that day of the week in the future.
  474.  
  475.    Days of the week may be spelled out in full: `Sunday', `Monday',
  476. `Tuesday', `Wednesday', `Thursday', `Friday' or `Saturday'.  Days may
  477. be abbreviated to their first three letters, optionally followed by a
  478. period.  The special abbreviations `Tues' for `Tuesday', `Wednes' for
  479. `Wednesday' and `Thur' or `Thurs' for `Thursday' are also allowed.
  480.  
  481.    A number may precede a day of the week item to move forward
  482. supplementary weeks.  It is best used in expression like `third
  483. monday'.  In this context, `last DAY' or `next DAY' is also acceptable;
  484. they move one week before or after the day that DAY by itself would
  485. represent.
  486.  
  487.    A comma following a day of the week item is ignored.
  488.  
  489. 
  490. File: sh-utils.info,  Node: Relative item in date strings,  Next: Pure numbers in date strings,  Prev: Day of week item,  Up: Date input formats
  491.  
  492. Relative item in date strings
  493. =============================
  494.  
  495.    "Relative items" adjust a date (or the current date if none) forward
  496. or backward.  The effects of relative items accumulate.  Here are some
  497. examples:
  498.  
  499.      1 year
  500.      1 year ago
  501.      3 years
  502.      2 days
  503.  
  504.    The unit of time displacement may be selected by the string `year'
  505. or `month' for moving by whole years or months.  These are fuzzy units,
  506. as years and months are not all of equal duration.  More precise units
  507. are `fortnight' which is worth 14 days, `week' worth 7 days, `day'
  508. worth 24 hours, `hour' worth 60 minutes, `minute' or `min' worth 60
  509. seconds, and `second' or `sec' worth one second.  An `s' suffix on
  510. these units is accepted and ignored.
  511.  
  512.    The unit of time may be preceded by a multiplier, given as an
  513. optionally signed number.  Unsigned numbers are taken as positively
  514. signed.  No number at all implies 1 for a multiplier.  Following a
  515. relative item by the string `ago' is equivalent to preceding the unit
  516. by a multiplicator with value -1.
  517.  
  518.    The string `tomorrow' is worth one day in the future (equivalent to
  519. `day'), the string `yesterday' is worth one day in the past (equivalent
  520. to `day ago').
  521.  
  522.    The strings `now' or `today' are relative items corresponding to
  523. zero-valued time displacement, these strings come from the fact a
  524. zero-valued time displacement represents the current time when not
  525. otherwise change by previous items.  They may be used to stress other
  526. items, like in `12:00 today'.  The string `this' also has the meaning
  527. of a zero-valued time displacement, but is preferred in date strings
  528. like `this thursday'.
  529.  
  530.    When a relative item makes the resulting date to cross the boundary
  531. between DST and non-DST (or vice-versa), the hour is adjusted according
  532. to the local time.
  533.  
  534. 
  535. File: sh-utils.info,  Node: Pure numbers in date strings,  Next: Authors of getdate,  Prev: Relative item in date strings,  Up: Date input formats
  536.  
  537. Pure numbers in date strings
  538. ============================
  539.  
  540.    The precise intepretation of a pure decimal number is dependent of
  541. the context in the date string.
  542.  
  543.    If the decimal number is of the form YYYYMMDD and no other calendar
  544. date item (*note Calendar date item::.) appears before it in the date
  545. string, then YYYY is read as the year, MM as the month number and DD as
  546. the day of the month, for the specified calendar date.
  547.  
  548.    If the decimal number is of the form HHMM and no other time of day
  549. item appears before it in the date string, then HH is read as the hour
  550. of the day and MM as the minute of the hour, for the specified time of
  551. the day.  MM can also be omitted.
  552.  
  553.    If both a calendar date and a time of day appear to the left of a
  554. number in the date string, but no relative item, then the number
  555. overrides the year.
  556.  
  557. 
  558. File: sh-utils.info,  Node: Authors of getdate,  Prev: Pure numbers in date strings,  Up: Date input formats
  559.  
  560. Authors of `getdate'
  561. ====================
  562.  
  563.    `getdate' was originally implemented by Steven M. Bellovin
  564. (`smb@research.att.com') while at the University of North Carolina at
  565. Chapel Hill.  The code was later tweaked by a couple of people on
  566. Usenet, then completely overhauled by Rich $alz (`rsalz@bbn.com') and
  567. Jim Berets (`jberets@bbn.com') in August, 1990.  Various revisions for
  568. the GNU system were made by David MacKenzie, Jim Meyering, and others.
  569.  
  570.    This chapter was originally produced by Franc,ois Pinard
  571. (`pinard@iro.umontreal.ca') from the `getdate.y' source code, and then
  572. edited by K. Berry (`kb@cs.umb.edu').
  573.  
  574. 
  575. File: sh-utils.info,  Node: Printing text,  Next: Conditions,  Prev: Date input formats,  Up: Top
  576.  
  577. Printing text
  578. *************
  579.  
  580.    This section describes commands that display text strings.
  581.  
  582. * Menu:
  583.  
  584. * echo invocation::             Print a line of text.
  585. * printf invocation::           Format and print data.
  586. * yes invocation::              Print a string until interrupted.
  587.  
  588. 
  589. File: sh-utils.info,  Node: echo invocation,  Next: printf invocation,  Up: Printing text
  590.  
  591. `echo': Print a line of text
  592. ============================
  593.  
  594.    `echo' writes each given STRING to standard output, with a space
  595. between each and a newline after the last one.  Synopsis:
  596.  
  597.      echo [OPTION]... [STRING]...
  598.  
  599.    The program accepts the following options.  Also see *Note Common
  600. options::.
  601.  
  602. `-n'
  603.      Do not output the trailing newline.
  604.  
  605. `-e'
  606.      Enable interpretation of the following backslash-escaped
  607.      characters in each STRING:
  608.  
  609.     `\a'
  610.           alert (bell)
  611.  
  612.     `\b'
  613.           backspace
  614.  
  615.     `\c'
  616.           suppress trailing newline
  617.  
  618.     `\f'
  619.           form feed
  620.  
  621.     `\n'
  622.           new line
  623.  
  624.     `\r'
  625.           carriage return
  626.  
  627.     `\t'
  628.           horizontal tab
  629.  
  630.     `\v'
  631.           vertical tab
  632.  
  633.     `\\'
  634.           backslash
  635.  
  636.     `\NNN'
  637.           the character whose ASCII code is NNN (octal); if NNN is not
  638.           a valid octal number, it is printed literally.
  639.  
  640. 
  641. File: sh-utils.info,  Node: printf invocation,  Next: yes invocation,  Prev: echo invocation,  Up: Printing text
  642.  
  643. `printf': Format and print data
  644. ===============================
  645.  
  646.    `printf' does formatted printing of text. Synopsis:
  647.  
  648.      printf FORMAT [ARGUMENT]...
  649.  
  650.    `printf' prints the FORMAT string, interpreting `%' directives and
  651. `\' escapes in the same way as the C `printf' function.  The FORMAT
  652. argument is re-used as necessary to convert all of the given ARGUMENTs.
  653.  
  654.    `printf' has one additional directive, `%b', which prints its
  655. argument string with `\' escapes interpreted in the same way as in the
  656. FORMAT string.
  657.  
  658.    `printf' interprets `\0ooo' in FORMAT as an octal number (if OOO is
  659. 0 to 3 octal digits) specifying a character to print, and `\xhhh' as a
  660. hexadecimal number (if HHH is 1 to 3 hex digits) specifying a character
  661. to print.
  662.  
  663.    An additional escape, `\c', causes `printf' to produce no further
  664. output.
  665.  
  666.    The only options are a lone `--help' or `--version'.  *Note Common
  667. options::.
  668.  
  669. 
  670. File: sh-utils.info,  Node: yes invocation,  Prev: printf invocation,  Up: Printing text
  671.  
  672. `yes': Print a string until interrupted
  673. =======================================
  674.  
  675.    `yes' prints the command line arguments, separated by spaces and
  676. followed by a newline, forever until it is killed.  If no arguments are
  677. given, it prints `y' followed by a newline forever until killed.
  678.  
  679.    The only options are a lone `--help' or `--version'.  *Note Common
  680. options::.
  681.  
  682. 
  683. File: sh-utils.info,  Node: Conditions,  Next: Redirection,  Prev: Printing text,  Up: Top
  684.  
  685. Conditions
  686. **********
  687.  
  688.    This section describes commands that are primarily useful for their
  689. exit status, rather than their output.  Thus, they are often used as the
  690. condition of shell `if' statements, or as the last command in a
  691. pipeline.
  692.  
  693. * Menu:
  694.  
  695. * false invocation::            Do nothing, unsuccessfully.
  696. * true invocation::             Do nothing, successfully.
  697. * test invocation::             Check file types and compare values.
  698. * expr invocation::             Evaluate expressions.
  699.  
  700. 
  701. File: sh-utils.info,  Node: false invocation,  Next: true invocation,  Up: Conditions
  702.  
  703. `false': Do nothing, unsuccessfully
  704. ===================================
  705.  
  706.    `false' does nothing except return an exit status of 1, meaning
  707. "failure".  It can be used as a place holder in shell scripts where an
  708. unsuccessful command is needed.
  709.  
  710.    Any arguments are ignored, except for a lone `--help' or `--version'
  711. (*note Common options::.).
  712.  
  713. 
  714. File: sh-utils.info,  Node: true invocation,  Next: test invocation,  Prev: false invocation,  Up: Conditions
  715.  
  716. `true': Do nothing, successfully
  717. ================================
  718.  
  719.    `true' does nothing except return an exit status of 0, meaning
  720. "success".  It can be used as a place holder in shell scripts where a
  721. successful command is needed, although the shell built-in command `:'
  722. (colon) may be faster.
  723.  
  724.    Any arguments are ignored, except for a lone `--help' or `--version'
  725. (*note Common options::.).
  726.  
  727. 
  728. File: sh-utils.info,  Node: test invocation,  Next: expr invocation,  Prev: true invocation,  Up: Conditions
  729.  
  730. `test': Check file types and compare values
  731. ===========================================
  732.  
  733.    `test' returns a status of 0 (true) or 1 (false) depending on the
  734. evaluation of the conditional expression EXPR.  Each part of the
  735. expression must be a separate argument.
  736.  
  737.    `test' has file status checks, string operators, and numeric
  738. comparison operators.
  739.  
  740.    Because most shells have a built-in command by the same name, using
  741. the unadorned command name in a script or interactively may get you
  742. different functionality than that described here.
  743.  
  744.    Besides the options below, `test' accepts a lone `--help' or
  745. `--version'.  *Note Common options::.  A single non-option argument is
  746. also allowed: `test' returns true if the argument is not null.
  747.  
  748. * Menu:
  749.  
  750. * File type tests::             -[bcdfhLpSt]
  751. * Access permission tests::     -[gkruwxOG]
  752. * File characteristics tests::  -e -s -nt -ot -ef
  753. * String tests::                -z -n = !=
  754. * Numeric tests::               -eq -ne -lt -le -gt -ge
  755. * Connectives for test::        ! -a -o
  756.  
  757. 
  758. File: sh-utils.info,  Node: File type tests,  Next: Access permission tests,  Up: test invocation
  759.  
  760. File type tests
  761. ---------------
  762.  
  763.    These options test for particular types of files.  (Everything's a
  764. file, but not all files are the same!)
  765.  
  766. `-b FILE'
  767.      True if FILE exists and is a block special device.
  768.  
  769. `-c FILE'
  770.      True if FILE exists and is a character special device.
  771.  
  772. `-d FILE'
  773.      True if FILE exists and is a directory.
  774.  
  775. `-f FILE'
  776.      True if FILE exists and is a regular file.
  777.  
  778. `-h FILE'
  779. `-L FILE'
  780.      True if FILE exists and is a symbolic link.
  781.  
  782. `-p FILE'
  783.      True if FILE exists and is a named pipe.
  784.  
  785. `-S FILE'
  786.      True if FILE exists and is a socket.
  787.  
  788. `-t [FD]'
  789.      True if FD is opened on a terminal.  If FD is omitted, it defaults
  790.      to 1 (standard output).
  791.  
  792. 
  793. File: sh-utils.info,  Node: Access permission tests,  Next: File characteristics tests,  Prev: File type tests,  Up: test invocation
  794.  
  795. Access permission tests
  796. -----------------------
  797.  
  798.    These options test for particular access permissions.
  799.  
  800. `-g FILE'
  801.      True if FILE exists and has its set-group-id bit set.
  802.  
  803. `-k FILE'
  804.      True if FILE has its "sticky" bit set.
  805.  
  806. `-r FILE'
  807.      True if FILE exists and is readable.
  808.  
  809. `-u FILE'
  810.      True if FILE exists and has its set-user-id bit set.
  811.  
  812. `-w FILE'
  813.      True if FILE exists and is writable.
  814.  
  815. `-x FILE'
  816.      True if FILE exists and is executable.
  817.  
  818. `-O FILE'
  819.      True if FILE exists and is owned by the current effective user id.
  820.  
  821. `-G FILE'
  822.      True if FILE exists and is owned by the current effective group id.
  823.  
  824. 
  825. File: sh-utils.info,  Node: File characteristics tests,  Next: String tests,  Prev: Access permission tests,  Up: test invocation
  826.  
  827. File characteristics tests
  828. --------------------------
  829.  
  830.    These options test other file characteristics.
  831.  
  832. `-e FILE'
  833.      True if FILE exists.
  834.  
  835. `-s FILE'
  836.      True if FILE exists and has a size greater than zero.
  837.  
  838. `FILE1 -nt FILE2'
  839.      True if FILE1 is newer (according to modification date) than FILE2.
  840.  
  841. `FILE1 -ot FILE2'
  842.      True if FILE1 is older (according to modification date) than FILE2.
  843.  
  844. `FILE1 -ef FILE2'
  845.      True if FILE1 and FILE2 have the same device and inode numbers,
  846.      i.e., if they are hard links to each other.
  847.  
  848. 
  849. File: sh-utils.info,  Node: String tests,  Next: Numeric tests,  Prev: File characteristics tests,  Up: test invocation
  850.  
  851. String tests
  852. ------------
  853.  
  854.    These options test string characteristics.  Strings are not quoted
  855. for `test', though you may need to quote them to protect characters
  856. with special meaning to the shell, e.g., spaces.
  857.  
  858. `-z STRING'
  859.      True if the length of STRING is zero.
  860.  
  861. `-n STRING'
  862. `STRING'
  863.      True if the length of STRING is nonzero.
  864.  
  865. `STRING1 = STRING2'
  866.      True if the strings are equal.
  867.  
  868. `STRING1 != STRING2'
  869.      True if the strings are not equal.
  870.  
  871. 
  872. File: sh-utils.info,  Node: Numeric tests,  Next: Connectives for test,  Prev: String tests,  Up: test invocation
  873.  
  874. Numeric tests
  875. -------------
  876.  
  877.    Numeric relationals.  The arguments must be entirely numeric
  878. (possibly negative), or the special expression `-l STRING', which
  879. evaluates to the length of STRING.
  880.  
  881. `ARG1 -eq ARG2'
  882. `ARG1 -ne ARG2'
  883. `ARG1 -lt ARG2'
  884. `ARG1 -le ARG2'
  885. `ARG1 -gt ARG2'
  886. `ARG1 -ge ARG2'
  887.      These arithmetic binary operators return true if ARG1 is equal,
  888.      not-equal, less-than, less-than-or-equal, greater-than, or
  889.      greater-than-or-equal than ARG2, respectively.
  890.  
  891.    For example:
  892.  
  893.      test -1 -gt -2 && echo yes
  894.      => yes
  895.      test -l abc -gt 1 && echo yes
  896.      => yes
  897.      test 0x100 -eq 1
  898.      error--> test: integer expression expected before -eq
  899.  
  900. 
  901. File: sh-utils.info,  Node: Connectives for test,  Prev: Numeric tests,  Up: test invocation
  902.  
  903. Connectives for `test'
  904. ----------------------
  905.  
  906.    The usual logical connectives.
  907.  
  908. `! EXPR'
  909.      True if EXPR is false.
  910.  
  911. `EXPR1 -a EXPR2'
  912.      True if both EXPR1 and EXPR2 are true.
  913.  
  914. `EXPR1 -o EXPR2'
  915.      True if either EXPR1 or EXPR2 is true.
  916.  
  917. 
  918. File: sh-utils.info,  Node: expr invocation,  Prev: test invocation,  Up: Conditions
  919.  
  920. `expr': Evaluate expressions
  921. ============================
  922.  
  923.    `expr' evaluates an expression and writes the result on standard
  924. output.  Each token of the expression must be a separate argument.
  925.  
  926.    Operands are either numbers or strings.  `expr' coerces anything
  927. appearing in an operand position to an integer or a string depending on
  928. the operation being applied to it.
  929.  
  930.    Strings are not quoted for `expr' itself, though you may need to
  931. quote them to protect characters with special meaning to the shell,
  932. e.g., spaces.
  933.  
  934.    Operators may given as infix symbols or prefix keywords.  Parentheses
  935. may be used for grouping in the usual manner (you must quote parentheses
  936. to avoid the shell evaluating them, however).
  937.  
  938.    Exit status:
  939.  
  940.      0 if the expression is neither null nor 0,
  941.      1 if the expression is null or 0,
  942.      2 for invalid expressions.
  943.  
  944. * Menu:
  945.  
  946. * Relations for expr::          | & < <= = == != >= >
  947. * Numeric expressions::         + - * / %
  948. * String expressions::          <colon> match substr index length quote
  949. * Examples of expr::            Examples.
  950.  
  951. 
  952. File: sh-utils.info,  Node: Relations for expr,  Next: Numeric expressions,  Up: expr invocation
  953.  
  954. Relations for `expr'
  955. --------------------
  956.  
  957.    The usual logical connectives and relations, in order of precedence.
  958.  
  959. `|'
  960.      Yields its first argument if it is neither null nor 0, otherwise
  961.      its second argument.
  962.  
  963. `&'
  964.      Yields its first argument if neither argument is null or 0,
  965.      otherwise 0.
  966.  
  967. `< <= = == != >= >'
  968.      Compare the arguments and return 1 if the relation is true, 0
  969.      otherwise.  `==' is a synonym for `='.  `expr' first tries to
  970.      coerce both arguments to numbers and do a numeric comparison; if
  971.      either coercion fails, it does a lexicographic comparison.
  972.  
  973. 
  974. File: sh-utils.info,  Node: Numeric expressions,  Next: String expressions,  Prev: Relations for expr,  Up: expr invocation
  975.  
  976. Numeric expressions
  977. -------------------
  978.  
  979.    Numeric operators, in order of increasing precedence.  The
  980. connectives (previous section) have higher precedence, the string
  981. operators (following section) have lower.
  982.  
  983. `+ -'
  984.      Addition and subtraction.  Both arguments are coerced to numbers;
  985.      an error occurs if this cannot be done.
  986.  
  987. `* / %'
  988.      Multiplication, division, remainder.  Both arguments are coerced to
  989.      numbers; an error occurs if this cannot be done.
  990.  
  991. 
  992. File: sh-utils.info,  Node: String expressions,  Next: Examples of expr,  Prev: Numeric expressions,  Up: expr invocation
  993.  
  994. String expressions
  995. ------------------
  996.  
  997.    String operators.  These have lowest precedence.
  998.  
  999. `STRING : REGEX'
  1000.      Perform pattern matching.  The arguments are coerced to strings
  1001.      and the second is considered to be a (basic, a la `grep') regular
  1002.      expression, with a `^' implicitly prepended.  The first argument is
  1003.      then matched against this regular expression.
  1004.  
  1005.      If the match succeeds and REGEX uses `\(' and `\)', the `:'
  1006.      expression returns the part of STRING that matched the
  1007.      subexpression; otherwise, it returns the number of characters
  1008.      matched.
  1009.  
  1010.      If the match fails, the `:' operator returns the null string if
  1011.      `\(' and `\)' are used in REGEX, otherwise 0.
  1012.  
  1013.      Only the first `\( ... \)' pair is relevant to the return value;
  1014.      additional pairs are meaningful only for grouping the regular
  1015.      expression operators.
  1016.  
  1017.      *Note Regular Expression Library: (regex)Top, for details of
  1018.      regular expression syntax.
  1019.  
  1020. `match STRING REGEX'
  1021.      An alternative way to do pattern matching.  This is the same as
  1022.      `STRING : REGEX'.
  1023.  
  1024. `substr STRING POSITION LENGTH'
  1025.      Returns the substring of STRING beginning at POSITION with length
  1026.      at most LENGTH.  If either POSITION or LENGTH is negative, zero,
  1027.      or non-numeric, returns the null string.
  1028.  
  1029. `index STRING CHARSET'
  1030.      Returns the first position in STRING where the first character in
  1031.      CHARSET was found.  If no character in CHARSET is found in STRING,
  1032.      return 0.
  1033.  
  1034. `length STRING'
  1035.      Returns the length of STRING.
  1036.  
  1037. `quote TOKEN'
  1038.      Interpret TOKEN as a string, even if it is a keyword like MATCH or
  1039.      an operator like `/'.  This makes it possible to test `expr length
  1040.      quote "$x"' or `expr quote "$x" : '.*/\(.\)'' and have it do the
  1041.      right thing even if the value of $X happens to be (for example)
  1042.      `/' or `index'.  This operator is a GNU extension.  It is disabled
  1043.      when the environment variable POSIXLY_CORRECT is set.
  1044.  
  1045.    To make `expr' interpret keywords as strings, you must use the
  1046. `quote' operator.
  1047.  
  1048. 
  1049. File: sh-utils.info,  Node: Examples of expr,  Prev: String expressions,  Up: expr invocation
  1050.  
  1051. Examples of `expr'
  1052. ------------------
  1053.  
  1054.    Here are a few examples, including quoting for shell metacharacters.
  1055.  
  1056.    To add 1 to the shell variable `foo', in Bourne-compatible shells:
  1057.      foo=`expr $foo + 1`
  1058.  
  1059.    To print the non-directory part of the file name stored in `$fname',
  1060. which need not contain a `/'.
  1061.      expr $fname : '.*/\(^.*\)' '^|' $fname
  1062.  
  1063.      expr abc : 'a\(.\)c'
  1064.      => b
  1065.      expr index abcdef cz
  1066.      => 3
  1067.      expr index index a
  1068.      error--> expr: syntax error
  1069.      expr index quote index a
  1070.      => 0
  1071.  
  1072. 
  1073. File: sh-utils.info,  Node: Redirection,  Next: File name manipulation,  Prev: Conditions,  Up: Top
  1074.  
  1075. Redirection
  1076. ***********
  1077.  
  1078.    Unix shells commonly provide several forms of "redirection"--ways to
  1079. change the input source or output destination of a command.  But one
  1080. useful redirection is performed by a separate command, not by the shell;
  1081. it's described here.
  1082.  
  1083. * Menu:
  1084.  
  1085. * tee invocation::              Redirect output to multiple files.
  1086.  
  1087. 
  1088. File: sh-utils.info,  Node: tee invocation,  Up: Redirection
  1089.  
  1090. `tee': Redirect output to multiple files
  1091. ========================================
  1092.  
  1093.    The `tee' command copies standard input to standard output and also
  1094. to any files given as arguments.  This is useful when you want not only
  1095. to send some data down a pipe, but also to save a copy.  Synopsis:
  1096.  
  1097.      tee [OPTION]... [FILE]...
  1098.  
  1099.    If a file being written to does not already exist, it is created.
  1100. If a file being written to already exists, the data it previously
  1101. contained is overwritten unless the `-a' option is used.
  1102.  
  1103.    The program accepts the following options.  Also see *Note Common
  1104. options::.
  1105.  
  1106. `-a'
  1107. `--append'
  1108.      Append standard input to the given files rather than overwriting
  1109.      them.
  1110.  
  1111. `-i'
  1112. `--ignore-interrupts'
  1113.      Ignore interrupt signals.
  1114.  
  1115. 
  1116. File: sh-utils.info,  Node: File name manipulation,  Next: Working context,  Prev: Redirection,  Up: Top
  1117.  
  1118. File name manipulation
  1119. **********************
  1120.  
  1121.    This section describes commands that manipulate file names.
  1122.  
  1123. * Menu:
  1124.  
  1125. * basename invocation::         Strip directory and suffix from a file name.
  1126. * dirname invocation::          Strip non-directory suffix from a file name.
  1127. * pathchk invocation::          Check file name portability.
  1128.  
  1129. 
  1130. File: sh-utils.info,  Node: basename invocation,  Next: dirname invocation,  Up: File name manipulation
  1131.  
  1132. `basename': Strip directory and suffix from a file name
  1133. =======================================================
  1134.  
  1135.    `basename' removes any leading directory components from NAME.
  1136. Synopsis:
  1137.  
  1138.      basename NAME [SUFFIX]
  1139.  
  1140.    If SUFFIX is specified and is identical to the end of NAME, it is
  1141. removed from NAME as well.  `basename' prints the result on standard
  1142. output.
  1143.  
  1144.    The only options are `--help' and `--version'.  *Note Common
  1145. options::.
  1146.  
  1147. 
  1148. File: sh-utils.info,  Node: dirname invocation,  Next: pathchk invocation,  Prev: basename invocation,  Up: File name manipulation
  1149.  
  1150. `dirname': Strip non-directory suffix from a file name
  1151. ======================================================
  1152.  
  1153.    `dirname' prints all but the final slash-delimited component of a
  1154. string (presumably a filename).  Synopsis:
  1155.  
  1156.      dirname NAME
  1157.  
  1158.    If NAME is a single component, `dirname' prints `.' (meaning the
  1159. current directory).
  1160.  
  1161.    The only options are `--help' and `--version'.  *Note Common
  1162. options::.
  1163.  
  1164. 
  1165. File: sh-utils.info,  Node: pathchk invocation,  Prev: dirname invocation,  Up: File name manipulation
  1166.  
  1167. `pathchk': Check file name portability
  1168. ======================================
  1169.  
  1170.    `pathchk' checks portability of filenames.  Synopsis:
  1171.  
  1172.      pathchk [OPTION]... NAME...
  1173.  
  1174.    For each NAME, `pathchk' prints a message if any of these conditions
  1175. is true:
  1176.   1. one of the existing directories in NAME does not have search
  1177.      (execute) permission,
  1178.  
  1179.   2. the length of NAME is larger than its filesystem's maximum file
  1180.      name length,
  1181.  
  1182.   3. the length of one component of NAME, corresponding to an existing
  1183.      directory name, is larger than its filesystem's maximum length for
  1184.      a file name component.
  1185.  
  1186.    The program accepts the following option.  Also see *Note Common
  1187. options::.
  1188.  
  1189. `-p'
  1190. `--portability'
  1191.      Instead of performing length checks on the underlying filesystem,
  1192.      test the length of each file name and its components against the
  1193.      POSIX.1 minimum limits for portability.  Also check that the file
  1194.      name contains no characters not in the portable file name
  1195.      character set.
  1196.  
  1197.    Exit status:
  1198.  
  1199.      0 if all specified file names passed all of the tests,
  1200.      1 otherwise.
  1201.  
  1202. 
  1203. File: sh-utils.info,  Node: Working context,  Next: User information,  Prev: File name manipulation,  Up: Top
  1204.  
  1205. Working context
  1206. ***************
  1207.  
  1208.    This section describes commands that display or alter the context in
  1209. which you are working: the current directory, the terminal settings, and
  1210. so forth.  See also the user-related commands in the next section.
  1211.  
  1212. * Menu:
  1213.  
  1214. * pwd invocation::              Print working directory.
  1215. * stty invocation::             Print or change terminal characteristics.
  1216. * printenv invocation::         Print environment variables.
  1217. * tty invocation::              Print file name of terminal on standard input.
  1218.  
  1219. 
  1220. File: sh-utils.info,  Node: pwd invocation,  Next: stty invocation,  Up: Working context
  1221.  
  1222. `pwd': Print working directory
  1223. ==============================
  1224.  
  1225.    `pwd' prints the fully resolved name of the current directory.  That
  1226. is, all components of the printed name will be actual directory
  1227. names--none will be symbolic links.
  1228.  
  1229.    Because most shells have a built-in command by the same name, using
  1230. the unadorned command name in a script or interactively may get you
  1231. different functionality than that described here.
  1232.  
  1233.    The only options are a lone `--help' or `--version'.  *Note Common
  1234. options::.
  1235.  
  1236. 
  1237. File: sh-utils.info,  Node: stty invocation,  Next: printenv invocation,  Prev: pwd invocation,  Up: Working context
  1238.  
  1239. `stty': Print or change terminal characteristics
  1240. ================================================
  1241.  
  1242.    `stty' prints or changes terminal characteristics, such as baud rate.
  1243. Synopses:
  1244.  
  1245.      stty [SETTING]...
  1246.      stty [OPTION]
  1247.  
  1248.    If given no arguments, `stty' prints the baud rate, line discipline
  1249. number (on systems that support it), and line settings that have been
  1250. changed from the values set by `stty sane'.  Mode reading and setting
  1251. are performed on the tty line connected to standard input.
  1252.  
  1253.    `stty' accepts many non-option arguments that change aspects of the
  1254. terminal line operation, as described below.
  1255.  
  1256.    The program accepts the following options.  Also see *Note Common
  1257. options::.
  1258.  
  1259. `-a'
  1260. `--all'
  1261.      Print all current settings in human-readable form.
  1262.  
  1263. `-g'
  1264. `--save'
  1265.      Print all current settings in a form that can be used as an
  1266.      argument to another `stty' command to restore the current settings.
  1267.  
  1268.    Many settings can be turned off by preceding them with a `-'.  Such
  1269. arguments are marked below with "May be negated" in their description.
  1270. The descriptions themselves refer to the positive case, that is, when
  1271. *not* negated (unless stated otherwise, of course).
  1272.  
  1273.    Some settings are not available on all POSIX systems, since they use
  1274. extensions.  Such arguments are marked below with "Non-POSIX" in their
  1275. description.  On non-POSIX systems, those or other settings also may not
  1276. be available, but it's not feasible to document all the variations: just
  1277. try it and see.
  1278.  
  1279. * Menu:
  1280.  
  1281. * Control::                     Control settings
  1282. * Input::                       Input settings
  1283. * Output::                      Output settings
  1284. * Local::                       Local settings
  1285. * Combination::                 Combination settings
  1286. * Characters::                  Special characters
  1287. * Special::                     Special settings
  1288.  
  1289. 
  1290. File: sh-utils.info,  Node: Control,  Next: Input,  Up: stty invocation
  1291.  
  1292. Control settings
  1293. ----------------
  1294.  
  1295.    Control settings:
  1296.  
  1297. `parenb'
  1298.      Generate parity bit in output and expect parity bit in input.  May
  1299.      be negated.
  1300.  
  1301. `parodd'
  1302.      Set odd parity (even if negated).  May be negated.
  1303.  
  1304. `cs5'
  1305. `cs6'
  1306. `cs7'
  1307. `cs8'
  1308.      Set character size to 5, 6, 7, or 8 bits.
  1309.  
  1310. `hup'
  1311. `hupcl'
  1312.      Send a hangup signal when the last process closes the tty.  May be
  1313.      negated.
  1314.  
  1315. `cstopb'
  1316.      Use two stop bits per character (one if negated).  May be negated.
  1317.  
  1318. `cread'
  1319.      Allow input to be received.  May be negated.
  1320.  
  1321. `clocal'
  1322.      Disable modem control signals.  May be negated.
  1323.  
  1324. `crtscts'
  1325.      Enable RTS/CTS flow control.  Non-POSIX.  May be negated.
  1326.  
  1327. 
  1328. File: sh-utils.info,  Node: Input,  Next: Output,  Prev: Control,  Up: stty invocation
  1329.  
  1330. Input settings
  1331. --------------
  1332.  
  1333. `ignbrk'
  1334.      Ignore break characters.  May be negated.
  1335.  
  1336. `brkint'
  1337.      Make breaks cause an interrupt signal.  May be negated.
  1338.  
  1339. `ignpar'
  1340.      Ignore characters with parity errors.  May be negated.
  1341.  
  1342. `parmrk'
  1343.      Mark parity errors (with a 255-0-character sequence).  May be
  1344.      negated.
  1345.  
  1346. `inpck'
  1347.      Enable input parity checking.  May be negated.
  1348.  
  1349. `istrip'
  1350.      Clear high (8th) bit of input characters.  May be negated.
  1351.  
  1352. `inlcr'
  1353.      Translate newline to carriage return.  May be negated.
  1354.  
  1355. `igncr'
  1356.      Ignore carriage return.  May be negated.
  1357.  
  1358. `icrnl'
  1359.      Translate carriage return to newline.  May be negated.
  1360.  
  1361. `ixon'
  1362.      Enable XON/XOFF flow control (that is, `CTRL-S'/`CTRL-Q').  May be
  1363.      negated.
  1364.  
  1365. `ixoff'
  1366. `tandem'
  1367.      Enable sending of `stop' character when the system input buffer is
  1368.      almost full, and `start' character when it becomes almost empty
  1369.      again.  May be negated.
  1370.  
  1371. `iuclc'
  1372.      Translate uppercase characters to lowercase.  Non-POSIX.  May be
  1373.      negated.
  1374.  
  1375. `ixany'
  1376.      Allow any character to restart output (only the start character if
  1377.      negated).  Non-POSIX.  May be negated.
  1378.  
  1379. `imaxbel'
  1380.      Enable beeping and not flushing input buffer if a character arrives
  1381.      when the input buffer is full.  Non-POSIX.  May be negated.
  1382.  
  1383. 
  1384. File: sh-utils.info,  Node: Output,  Next: Local,  Prev: Input,  Up: stty invocation
  1385.  
  1386. Output settings
  1387. ---------------
  1388.  
  1389.    These arguments specify output-related operations.
  1390.  
  1391. `opost'
  1392.      Postprocess output.  May be negated.
  1393.  
  1394. `olcuc'
  1395.      Translate lowercase characters to uppercase.  Non-POSIX.  May be
  1396.      negated.
  1397.  
  1398. `ocrnl'
  1399.      Translate carriage return to newline.  Non-POSIX.  May be negated.
  1400.  
  1401. `onlcr'
  1402.      Translate newline to carriage return-newline.  Non-POSIX.  May be
  1403.      negated.
  1404.  
  1405. `onocr'
  1406.      Do not print carriage returns in the first column.  Non-POSIX.
  1407.      May be negated.
  1408.  
  1409. `onlret'
  1410.      Newline performs a carriage return.  Non-POSIX.  May be negated.
  1411.  
  1412. `ofill'
  1413.      Use fill (padding) characters instead of timing for delays.
  1414.      Non-POSIX.  May be negated.
  1415.  
  1416. `ofdel'
  1417.      Use delete characters for fill instead of null characters.
  1418.      Non-POSIX.  May be negated.
  1419.  
  1420. `nl1'
  1421. `nl0'
  1422.      Newline delay style.  Non-POSIX.
  1423.  
  1424. `cr3'
  1425. `cr2'
  1426. `cr1'
  1427. `cr0'
  1428.      Carriage return delay style.  Non-POSIX.
  1429.  
  1430. `tab3'
  1431. `tab2'
  1432. `tab1'
  1433. `tab0'
  1434.      Horizontal tab delay style.  Non-POSIX.
  1435.  
  1436. `bs1'
  1437. `bs0'
  1438.      Backspace delay style.  Non-POSIX.
  1439.  
  1440. `vt1'
  1441. `vt0'
  1442.      Vertical tab delay style.  Non-POSIX.
  1443.  
  1444. `ff1'
  1445. `ff0'
  1446.      Form feed delay style.  Non-POSIX.
  1447.  
  1448. 
  1449. File: sh-utils.info,  Node: Local,  Next: Combination,  Prev: Output,  Up: stty invocation
  1450.  
  1451. Local settings
  1452. --------------
  1453.  
  1454. `isig'
  1455.      Enable `interrupt', `quit', and `suspend' special characters.  May
  1456.      be negated.
  1457.  
  1458. `icanon'
  1459.      Enable `erase', `kill', `werase', and `rprnt' special characters.
  1460.      May be negated.
  1461.  
  1462. `iexten'
  1463.      Enable non-POSIX special characters.  May be negated.
  1464.  
  1465. `echo'
  1466.      Echo input characters.  May be negated.
  1467.  
  1468. `echoe'
  1469. `crterase'
  1470.      Echo `erase' characters as backspace-space-backspace.  May be
  1471.      negated.
  1472.  
  1473. `echok'
  1474.      Echo a newline after a `kill' character.  May be negated.
  1475.  
  1476. `echonl'
  1477.      Echo newline even if not echoing other characters.  May be negated.
  1478.  
  1479. `noflsh'
  1480.      Disable flushing after `interrupt' and `quit' special characters.
  1481.      May be negated.
  1482.  
  1483. `xcase'
  1484.      Enable input and output of uppercase characters by preceding their
  1485.      lowercase equivalents with `\', when `icanon' is set.  Non-POSIX.
  1486.      May be negated.
  1487.  
  1488. `tostop'
  1489.      Stop background jobs that try to write to the terminal.  Non-POSIX.
  1490.      May be negated.
  1491.  
  1492. `echoprt'
  1493. `prterase'
  1494.      Echo erased characters backward, between `\' and `/'.  Non-POSIX.
  1495.      May be negated.
  1496.  
  1497. `echoctl'
  1498. `ctlecho'
  1499.      Echo control characters in hat notation (`^C') instead of
  1500.      literally.  Non-POSIX.  May be negated.
  1501.  
  1502. `echoke'
  1503. `crtkill'
  1504.      Echo the `kill' special character by erasing each character on the
  1505.      line as indicated by the `echoprt' and `echoe' settings, instead
  1506.      of by the `echoctl' and `echok' settings.  Non-POSIX.  May be
  1507.      negated.
  1508.  
  1509. 
  1510. File: sh-utils.info,  Node: Combination,  Next: Characters,  Prev: Local,  Up: stty invocation
  1511.  
  1512. Combination settings
  1513. --------------------
  1514.  
  1515.    Combination settings:
  1516.  
  1517. `evenp'
  1518. `parity'
  1519.      Same as `parenb -parodd cs7'.  May be negated.  If negated, same
  1520.      as `-parenb cs8'.
  1521.  
  1522. `oddp'
  1523.      Same as `parenb parodd cs7'.  May be negated.  If negated, same as
  1524.      `-parenb cs8'.
  1525.  
  1526. `nl'
  1527.      Same as `-icrnl -onlcr'.  May be negated.  If negated, same as
  1528.      `icrnl -inlcr -igncr onlcr -ocrnl -onlret'.
  1529.  
  1530. `ek'
  1531.      Reset the `erase' and `kill' special characters to their default
  1532.      values.
  1533.  
  1534. `sane'
  1535.      Same as:
  1536.           cread -ignbrk brkint -inlcr -igncr icrnl -ixoff -iuclc -ixany
  1537.           imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel
  1538.           nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl
  1539.           -noflsh -xcase -tostop -echoprt echoctl echoke
  1540.       and also sets all special characters to their default values.
  1541.  
  1542. `cooked'
  1543.      Same as `brkint ignpar istrip icrnl ixon opost isig icanon', plus
  1544.      sets the `eof' and `eol' characters to their default values if
  1545.      they are the same as the `min' and `time' characters.  May be
  1546.      negated.  If negated, same as `raw'.
  1547.  
  1548. `raw'
  1549.      Same as:
  1550.           -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr
  1551.           -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon
  1552.           -xcase min 1 time 0
  1553.       May be negated.  If negated, same as `cooked'.
  1554.  
  1555. `cbreak'
  1556.      Same as `-icanon'.  May be negated.  If negated, same as `icanon'.
  1557.  
  1558. `pass8'
  1559.      Same as `-parenb -istrip cs8'.  May be negated.  If negated, same
  1560.      as `parenb istrip cs7'.
  1561.  
  1562. `litout'
  1563.      Same as `-parenb -istrip -opost cs8'.  May be negated.  If
  1564.      negated, same as `parenb istrip opost cs7'.
  1565.  
  1566. `decctlq'
  1567.      Same as `-ixany'.  Non-POSIX.  May be negated.
  1568.  
  1569. `tabs'
  1570.      Same as `tab0'.  Non-POSIX.  May be negated.  If negated, same as
  1571.      `tab3'.
  1572.  
  1573. `lcase'
  1574. `LCASE'
  1575.      Same as `xcase iuclc olcuc'.  Non-POSIX.  May be negated.
  1576.  
  1577. `crt'
  1578.      Same as `echoe echoctl echoke'.
  1579.  
  1580. `dec'
  1581.      Same as `echoe echoctl echoke -ixany intr ^C erase ^? kill C-u'.
  1582.  
  1583. 
  1584. File: sh-utils.info,  Node: Characters,  Next: Special,  Prev: Combination,  Up: stty invocation
  1585.  
  1586. Special characters
  1587. ------------------
  1588.  
  1589.    The special characters' default values vary from system to system.
  1590. They are set with the syntax `name value', where the names are listed
  1591. below and the value can be given either literally, in hat notation
  1592. (`^C'), or as an integer which may start with `0x' to indicate
  1593. hexadecimal, `0' to indicate octal, or any other digit to indicate
  1594. decimal.
  1595.  
  1596.    For GNU stty, giving a value of `^-' or `undef' disables that
  1597. special character.  (This is incompatible with Ultrix `stty', which
  1598. uses  a value of `u' to disable a special character.  GNU `stty' treats
  1599. a value `u' like any other, namely to set that special character to
  1600. <U>.)
  1601.  
  1602. `intr'
  1603.      Send an interrupt signal.
  1604.  
  1605. `quit'
  1606.      Send a quit signal.
  1607.  
  1608. `erase'
  1609.      Erase the last character typed.
  1610.  
  1611. `kill'
  1612.      Erase the current line.
  1613.  
  1614. `eof'
  1615.      Send an end of file (terminate the input).
  1616.  
  1617. `eol'
  1618.      End the line.
  1619.  
  1620. `eol2'
  1621.      Alternate character to end the line.  Non-POSIX.
  1622.  
  1623. `swtch'
  1624.      Switch to a different shell layer.  Non-POSIX.
  1625.  
  1626. `start'
  1627.      Restart the output after stopping it.
  1628.  
  1629. `stop'
  1630.      Stop the output.
  1631.  
  1632. `susp'
  1633.      Send a terminal stop signal.
  1634.  
  1635. `dsusp'
  1636.      Send a terminal stop signal after flushing the input.  Non-POSIX.
  1637.  
  1638. `rprnt'
  1639.      Redraw the current line.  Non-POSIX.
  1640.  
  1641. `werase'
  1642.      Erase the last word typed.  Non-POSIX.
  1643.  
  1644. `lnext'
  1645.      Enter the next character typed literally, even if it is a special
  1646.      character.  Non-POSIX.
  1647.  
  1648. 
  1649. File: sh-utils.info,  Node: Special,  Prev: Characters,  Up: stty invocation
  1650.  
  1651. Special settings
  1652. ----------------
  1653.  
  1654. `min N'
  1655.      Set the minimum number of characters that will satisfy a read until
  1656.      the time value has expired, when `-icanon' is set.
  1657.  
  1658. `time N'
  1659.      Set the number of tenths of a second before reads time out if the
  1660.      min number of characters have not been read, when `-icanon' is set.
  1661.  
  1662. `ispeed N'
  1663.      Set the input speed to N.
  1664.  
  1665. `ospeed N'
  1666.      Set the output speed to N.
  1667.  
  1668. `rows N'
  1669.      Tell the tty kernel driver that the terminal has N rows.
  1670.      Non-POSIX.
  1671.  
  1672. `cols N'
  1673. `columns N'
  1674.      Tell the kernel that the terminal has N columns.  Non-POSIX.
  1675.  
  1676. `size'
  1677.      Print the number of rows and columns that the kernel thinks the
  1678.      terminal has.  (Systems that don't support rows and cols in the
  1679.      kernel typically use the environment variables `LINES' and
  1680.      `COLUMNS' instead; however, GNU `stty' does not know anything
  1681.      about them.) Non-POSIX.
  1682.  
  1683. `line N'
  1684.      Use line discipline N.  Non-POSIX.
  1685.  
  1686. `speed'
  1687.      Print the terminal speed.
  1688.  
  1689. `N'
  1690.      Set the input and output speeds to N.  N can be one of: 0 50 75
  1691.      110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 19200 38400
  1692.      `exta' `extb'.  `exta' is the same as 19200; `extb' is the same as
  1693.      38400.  0 hangs up the line if `-clocal' is set.
  1694.  
  1695. 
  1696. File: sh-utils.info,  Node: printenv invocation,  Next: tty invocation,  Prev: stty invocation,  Up: Working context
  1697.  
  1698. `printenv': Print all or some environment variables
  1699. ===================================================
  1700.  
  1701.    `printenv' prints environment variable values.  Synopsis:
  1702.  
  1703.      printenv [OPTION] [VARIABLE]...
  1704.  
  1705.    If no VARIABLEs are specified, `printenv' prints the value of every
  1706. environment variable.  Otherwise, it prints the value of each VARIABLE
  1707. that is set, and nothing for those that are not set.
  1708.  
  1709.    The only options are a lone `--help' or `--version'.  *Note Common
  1710. options::.
  1711.  
  1712.    Exit status:
  1713.  
  1714.      0 if all variables specified were found
  1715.      1 if at least one specified variable was not found
  1716.      2 if a write error occurred
  1717.  
  1718. 
  1719. File: sh-utils.info,  Node: tty invocation,  Prev: printenv invocation,  Up: Working context
  1720.  
  1721. `tty': Print file name of terminal on standard input
  1722. ====================================================
  1723.  
  1724.    `tty' prints the file name of the terminal connected to its standard
  1725. input.  It prints `not a tty' if standard input is not a terminal.
  1726. Synopsis:
  1727.  
  1728.      tty [OPTION]...
  1729.  
  1730.    The program accepts the following option.  Also see *Note Common
  1731. options::.
  1732.  
  1733. `-s'
  1734. `--silent'
  1735. `--quiet'
  1736.      Print nothing; only return an exit status.
  1737.  
  1738.    Exit status:
  1739.  
  1740.      0 if standard input is a terminal
  1741.      1 if standard input is not a terminal
  1742.      2 if given incorrect arguments
  1743.      3 if a write error occurs
  1744.  
  1745. 
  1746. File: sh-utils.info,  Node: User information,  Next: System context,  Prev: Working context,  Up: Top
  1747.  
  1748. User information
  1749. ****************
  1750.  
  1751.    This section describes commands that print user-related information:
  1752. logins, groups, and so forth.
  1753.  
  1754. * Menu:
  1755.  
  1756. * id invocation::               Print real and effective uid and gid.
  1757. * logname invocation::          Print current login name.
  1758. * whoami invocation::           Print effective user id.
  1759. * groups invocation::           Print group names a user is in.
  1760. * users invocation::            Print login names of users currently logged in.
  1761. * who invocation::              Print who is currently logged in.
  1762.  
  1763. 
  1764. File: sh-utils.info,  Node: id invocation,  Next: logname invocation,  Up: User information
  1765.  
  1766. `id': Print real and effective uid and gid
  1767. ==========================================
  1768.  
  1769.    `id' prints information about the given user, or the process running
  1770. it if no user is specified.  Synopsis:
  1771.  
  1772.      id [OPTION]... [USERNAME]
  1773.  
  1774.    By default, it prints the real user id, real group id, effective
  1775. user id if different from the real user id, effective group id if
  1776. different from the real group id, and supplemental group ids.
  1777.  
  1778.    Each of these numeric values is preceded by an identifying string and
  1779. followed by the corresponding user or group name in parentheses.
  1780.  
  1781.    The options cause `id' to print only part of the above information.
  1782. Also see *Note Common options::.
  1783.  
  1784. `-g'
  1785. `--group'
  1786.      Print only the group id.
  1787.  
  1788. `-G'
  1789. `--groups'
  1790.      Print only the supplementary groups.
  1791.  
  1792. `-n'
  1793. `--name'
  1794.      Print the user or group name instead of the ID number.  Requires
  1795.      `-u', `-g', or `-G'.
  1796.  
  1797. `-r'
  1798. `--real'
  1799.      Print the real, instead of effective, user or group id.  Requires
  1800.      `-u', `-g', or `-G'.
  1801.  
  1802. `-u'
  1803. `--user'
  1804.      Print only the user id.
  1805.  
  1806. 
  1807. File: sh-utils.info,  Node: logname invocation,  Next: whoami invocation,  Prev: id invocation,  Up: User information
  1808.  
  1809. `logname': Print current login name
  1810. ===================================
  1811.  
  1812.    `logname' prints the calling user's name, as found in the file
  1813. `/etc/utmp', and exits with a status of 0.  If there is no `/etc/utmp'
  1814. entry for the calling process, `logname' prints an error message and
  1815. exits with a status of 1.
  1816.  
  1817.    The only options are `--help' and `--version'.  *Note Common
  1818. options::.
  1819.  
  1820. 
  1821. File: sh-utils.info,  Node: whoami invocation,  Next: groups invocation,  Prev: logname invocation,  Up: User information
  1822.  
  1823. `whoami': Print effective user id
  1824. =================================
  1825.  
  1826.    `whoami' prints the user name associated with the current effective
  1827. user id.  It is equivalent to the command `id -un'.
  1828.  
  1829.    The only options are `--help' and `--version'.  *Note Common
  1830. options::.
  1831.  
  1832. 
  1833. File: sh-utils.info,  Node: groups invocation,  Next: users invocation,  Prev: whoami invocation,  Up: User information
  1834.  
  1835. `groups': Print group names a user is in
  1836. ========================================
  1837.  
  1838.    `groups' prints the names of the primary and any supplementary
  1839. groups for each given USERNAME, or the current process if no names are
  1840. given.  If names are given, the name of each user is printed before the
  1841. list of that user's groups.  Synopsis:
  1842.  
  1843.      groups [USERNAME]...
  1844.  
  1845.    The group lists are equivalent to the output of the command `id -Gn'.
  1846.  
  1847.    The only options are `--help' and `--version'.  *Note Common
  1848. options::.
  1849.  
  1850. 
  1851. File: sh-utils.info,  Node: users invocation,  Next: who invocation,  Prev: groups invocation,  Up: User information
  1852.  
  1853. `users': Print login names of users currently logged in
  1854. =======================================================
  1855.  
  1856.    `users' prints on a single line a blank-separated list of user names
  1857. of users currently logged in to the current host.  Each user name
  1858. corresponds to a login session, so if a user has more than one login
  1859. session, that user's name will appear the same number of times in the
  1860. output. Synopsis:
  1861.  
  1862.      users [FILE]
  1863.  
  1864.    With no FILE argument, `users' extracts its information from the
  1865. file `/etc/utmp'.  If a file argument is given, `users' uses that file
  1866. instead.  A common choice is `/etc/wtmp'.
  1867.  
  1868.    The only options are `--help' and `--version'.  *Note Common
  1869. options::.
  1870.  
  1871. 
  1872. File: sh-utils.info,  Node: who invocation,  Prev: users invocation,  Up: User information
  1873.  
  1874. `who': Print who is currently logged in
  1875. =======================================
  1876.  
  1877.    `who' prints information about users who are currently logged on.
  1878. Synopsis:
  1879.  
  1880.      `who' [OPTION] [FILE] [am i]
  1881.  
  1882.    If given no non-option arguments, `who' prints the following
  1883. information for each user currently logged on: login name, terminal
  1884. line, login time, and remote hostname or X display.
  1885.  
  1886.    If given one non-option argument, `who' uses that instead of
  1887. `/etc/utmp' as the name of the file containing the record of users
  1888. logged on.  `/etc/wtmp' is commonly given as an argument to `who' to
  1889. look at who has previously logged on.
  1890.  
  1891.    If given two non-option arguments, `who' prints only the entry for
  1892. the user running it (determined from its standard input), preceded by
  1893. the hostname.  Traditionally, the two arguments given are `am i', as in
  1894. `who am i'.
  1895.  
  1896.    The program accepts the following options.  Also see *Note Common
  1897. options::.
  1898.  
  1899. `-m'
  1900.      Same as `who am i'.
  1901.  
  1902. `-q'
  1903. `--count'
  1904.      Print only the login names and the number of users logged on.
  1905.      Overrides all other options.
  1906.  
  1907. `-s'
  1908.      Ignored; for compatibility with other versions of `who'.
  1909.  
  1910. `-i'
  1911. `-u'
  1912. `--idle'
  1913.      After the login time, print the number of hours and minutes that
  1914.      the user has been idle.  `.' means the user was active in last
  1915.      minute.  `old' means the user was idle for more than 24 hours.
  1916.  
  1917. `-H'
  1918. `--heading'
  1919.      Print a line of column headings.
  1920.  
  1921. `-w'
  1922. `-T'
  1923. `--mesg'
  1924. `--message'
  1925. `--writable'
  1926.      After each login name print a character indicating the user's
  1927.      message status:
  1928.  
  1929.           `+' allowing `write' messages
  1930.           `-' disallowing `write' messages
  1931.           `?' cannot find terminal device
  1932.  
  1933. 
  1934. File: sh-utils.info,  Node: System context,  Next: Modified command invocation,  Prev: User information,  Up: Top
  1935.  
  1936. System context
  1937. **************
  1938.  
  1939.    This section describes commands that print or change system-wide
  1940. information.
  1941.  
  1942. * Menu:
  1943.  
  1944. * date invocation::             Print or set system date and time.
  1945. * uname invocation::            Print system information.
  1946. * hostname invocation::         Print or set system name.
  1947.  
  1948. 
  1949. File: sh-utils.info,  Node: date invocation,  Next: uname invocation,  Up: System context
  1950.  
  1951. `date': Print or set system date and time
  1952. =========================================
  1953.  
  1954.    `date' with no arguments prints the current time and date, in the
  1955. format of the `%c' directive (described below).  Synopses:
  1956.  
  1957.      date [OPTION]... [+FORMAT]
  1958.      date [-u|--utc|--universal] [ MMDDHHMM[[CC]YY][.SS] ]
  1959.  
  1960.    If given an argument that starts with a `+', `date' prints the
  1961. current time and date (or the time and date specified by the `--date'
  1962. option, see below) in the format defined by that argument, which is the
  1963. same as in the `strftime' function.  Except for directives, which start
  1964. with `%', characters in the format string are printed unchanged.  The
  1965. directives are described below.
  1966.  
  1967. * Menu:
  1968.  
  1969. * Time directives::             %[HIklMprsSTXzZ]
  1970. * Date directives::             %[aAbBcdDhjmUwWxyY]
  1971. * Literal directives::          %[%nt]
  1972. * Padding::                     Pad with zeroes, spaces (%_), or nothing (%-).
  1973. * Setting the time::            Changing the system clock.
  1974. * Options for date::            Instead of the current time.
  1975. * Examples of date::            Examples.
  1976.  
  1977. 
  1978. File: sh-utils.info,  Node: Time directives,  Next: Date directives,  Up: date invocation
  1979.  
  1980. Time directives
  1981. ---------------
  1982.  
  1983.    `date' directives related to times.
  1984.  
  1985. `%H'
  1986.      hour (00...23)
  1987.  
  1988. `%I'
  1989.      hour (01...12)
  1990.  
  1991. `%k'
  1992.      hour ( 0...23)
  1993.  
  1994. `%l'
  1995.      hour ( 1...12)
  1996.  
  1997. `%M'
  1998.      minute (00...59)
  1999.  
  2000. `%p'
  2001.      locale's AM or PM
  2002.  
  2003. `%r'
  2004.      time, 12-hour (hh:mm:ss [AP]M)
  2005.  
  2006. `%s'
  2007.      seconds since the epoch, i.e., 1 January 1970 00:00:00 UTC (a GNU
  2008.      extension).  Note that this value is the number of seconds between
  2009.      the epoch and the current date as defined by the localtime system
  2010.      call.  It isn't changed by the `--date' option.
  2011.  
  2012. `%S'
  2013.      second (00...61)
  2014.  
  2015. `%T'
  2016.      time, 24-hour (hh:mm:ss)
  2017.  
  2018. `%X'
  2019.      locale's time representation (%H:%M:%S)
  2020.  
  2021. `%z'
  2022.      RFC-822 style numeric time zone (e.g., -0600 or +0100), or nothing
  2023.      if no time zone is determinable.  This value reflects the
  2024.      *current* time zone.  It isn't changed by the `--date' option.
  2025.  
  2026. `%Z'
  2027.      time zone (e.g., EDT), or nothing if no timezone is determinable.
  2028.      Note that this value reflects the *current* time zone.  It isn't
  2029.      changed by the `--date' option.
  2030.  
  2031. 
  2032. File: sh-utils.info,  Node: Date directives,  Next: Literal directives,  Prev: Time directives,  Up: date invocation
  2033.  
  2034. Date directives
  2035. ---------------
  2036.  
  2037.    `date' directives related to dates.
  2038.  
  2039. `%a'
  2040.      locale's abbreviated weekday name (Sun...Sat)
  2041.  
  2042. `%A'
  2043.      locale's full weekday name, variable length (Sunday...Saturday)
  2044.  
  2045. `%b'
  2046.      locale's abbreviated month name (Jan...Dec)
  2047.  
  2048. `%B'
  2049.      locale's full month name, variable length (January...December)
  2050.  
  2051. `%c'
  2052.      locale's date and time (Sat Nov 04 12:02:33 EST 1989)
  2053.  
  2054. `%d'
  2055.      day of month (01...31)
  2056.  
  2057. `%D'
  2058.      date (mm/dd/yy)
  2059.  
  2060. `%h'
  2061.      same as %b
  2062.  
  2063. `%j'
  2064.      day of year (001...366)
  2065.  
  2066. `%m'
  2067.      month (01...12)
  2068.  
  2069. `%U'
  2070.      week number of year with Sunday as first day of week (00...53).
  2071.      Days in a new year preceding the first Sunday are in week zero.
  2072.  
  2073. `%V'
  2074.      week number of year with Monday as first day of the week as a
  2075.      decimal (01...53). If the week containing January 1 has four or
  2076.      more days in the new year, then it is considered week 1;
  2077.      otherwise, it is week 53 of the previous year, and the next week
  2078.      is week 1. (See the ISO 8601: 1988 standard.)
  2079.  
  2080. `%w'
  2081.      day of week (0...6) with 0 corresponding to Sunday
  2082.  
  2083. `%W'
  2084.      week number of year with Monday as first day of week (00...53).
  2085.      Days in a new year preceding the first Monday are in week zero.
  2086.  
  2087. `%x'
  2088.      locale's date representation (mm/dd/yy)
  2089.  
  2090. `%y'
  2091.      last two digits of year (00...99)
  2092.  
  2093. `%Y'
  2094.      year (1970....)
  2095.  
  2096. 
  2097. File: sh-utils.info,  Node: Literal directives,  Next: Padding,  Prev: Date directives,  Up: date invocation
  2098.  
  2099. Literal directives
  2100. ------------------
  2101.  
  2102.    `date' directives that produce literal strings.
  2103.  
  2104. `%%'
  2105.      a literal %
  2106.  
  2107. `%n'
  2108.      a newline
  2109.  
  2110. `%t'
  2111.      a horizontal tab
  2112.  
  2113. 
  2114. File: sh-utils.info,  Node: Padding,  Next: Setting the time,  Prev: Literal directives,  Up: date invocation
  2115.  
  2116. Padding
  2117. -------
  2118.  
  2119.    By default, `date' pads numeric fields with zeroes, so that, for
  2120. example, numeric months are always output as two digits. GNU `date'
  2121. recognizes the following numeric modifiers between the `%' and the
  2122. directive.
  2123.  
  2124. `-'
  2125.      (hyphen) do not pad the field; useful if the output is intended for
  2126.      human consumption.
  2127.  
  2128. `_'
  2129.      (underscore) pad the field with spaces; useful if you need a fixed
  2130.      number of characters in the output, but zeroes are too distracting.
  2131.  
  2132. These are GNU extensions.
  2133.  
  2134.    Here is an example illustrating the differences:
  2135.  
  2136.      date +%d/%m -d "Feb 1"
  2137.      => 01/02
  2138.      date +%-d/%-m -d "Feb 1"
  2139.      => 1/2
  2140.      date +%_d/%_m -d "Feb 1"
  2141.      =>  1/ 2
  2142.  
  2143. 
  2144. File: sh-utils.info,  Node: Setting the time,  Next: Options for date,  Prev: Padding,  Up: date invocation
  2145.  
  2146. Setting the time
  2147. ----------------
  2148.  
  2149.    If given an argument that does not start with `+', `date' sets the
  2150. system clock to the time and date specified by that argument (as
  2151. described below).  You must have appropriate privileges to set the
  2152. system clock.  The `--date' and `--set' options may not be used with
  2153. such an argument.  The `--universal' option may be used with such an
  2154. argument to indicate that the specified time and date are relative to
  2155. Coordinated Universal Time rather than to the local time zone.
  2156.  
  2157.    The argument must consist entirely of digits, which have the
  2158. following meaning:
  2159.  
  2160. MM
  2161.      month
  2162.  
  2163. DD
  2164.      day within month
  2165.  
  2166. HH
  2167.      hour
  2168.  
  2169. MM
  2170.      minute
  2171.  
  2172. CC
  2173.      first two digits of year (optional)
  2174.  
  2175. YY
  2176.      last two digits of year (optional)
  2177.  
  2178. SS
  2179.      second (optional)
  2180.  
  2181.    The `--set' option also sets the system clock; see the next section.
  2182.  
  2183. 
  2184. File: sh-utils.info,  Node: Options for date,  Next: Examples of date,  Prev: Setting the time,  Up: date invocation
  2185.  
  2186. Options for `date'
  2187. ------------------
  2188.  
  2189.    The program accepts the following options.  Also see *Note Common
  2190. options::.
  2191.  
  2192. `-d DATESTR'
  2193. `--date=DATESTR'
  2194.      Display the time and date specified in DATESTR instead of the
  2195.      current time and date.  DATESTR can be in almost any common
  2196.      format.  It can contain month names, timezones, `am' and `pm',
  2197.      `yesterday', `ago', `next', etc.  *Note Date input formats::.
  2198.  
  2199. `-f DATEFILE'
  2200. `--file=DATEFILE'
  2201.      Parse each line in DATEFILE as with `-d' and display the resulting
  2202.      time and date.  If DATEFILE is `-', use standard input.  This is
  2203.      useful when you have many dates to process, because the system
  2204.      overhead of starting up the `date' executable many times can be
  2205.      considerable.
  2206.  
  2207. `--rfc-822'
  2208.      Display the time and date using the RFC-822-specified format, `%a,
  2209.      %_d %b %Y %H:%M:%S %z'.  If `--utc' is also specified, use `GMT'
  2210.      in place of `%z'.
  2211.  
  2212. `-r FILE'
  2213. `--reference=FILE'
  2214.      Display the time and date reference according to the last
  2215.      modification time of FILE, instead of the current time and date.
  2216.  
  2217. `-s DATESTR'
  2218. `--set=DATESTR'
  2219.      Set the time and date to DATESTR,  See `-d' above.
  2220.  
  2221. `-u'
  2222. `--utc'
  2223. `--universal'
  2224.      Print or set the time and date in Universal Coordinated Time
  2225.      instead of in local (wall clock) time.
  2226.  
  2227. 
  2228. File: sh-utils.info,  Node: Examples of date,  Prev: Options for date,  Up: date invocation
  2229.  
  2230. Examples of `date'
  2231. ------------------
  2232.  
  2233.    Here are a few examples.  Also see the documentation for the `-d'
  2234. option in the previous section.
  2235.  
  2236.    * To print the date of the day before yesterday:
  2237.  
  2238.           date --date='2 days ago'
  2239.  
  2240.    * To print the date of the day three months and one day hence:
  2241.           date --date='3 months 1 day'
  2242.  
  2243.    * To print the day of year of Christmas in the current year:
  2244.           date --date='25 Dec' +%j
  2245.  
  2246.    * To print the current full month name and the day of the month:
  2247.           date '+%B %d'
  2248.  
  2249.      But this may not be what you want because for the first nine days
  2250.      of the month, the `%d' expands to a zero-padded two-digit field,
  2251.      for example `date -d 1may '+%B %d'' will print `May 01'.
  2252.  
  2253.    * To print a date without the leading zero for one-digit days of the
  2254.      month, you can use the (GNU extension) `-' modifier to suppress
  2255.      the padding altogether.
  2256.           date -d=1may '+%B %-d'
  2257.  
  2258.    * To print the current date and time in the format required by many
  2259.      non-GNU versions of `date' when setting the system clock:
  2260.           date +%m%d%H%M%Y.%S
  2261.  
  2262.    * To set the system clock forward by two minutes:
  2263.           date --set='+2 minutes'
  2264.  
  2265.    * To print the date in the format specified by RFC-822, use `date
  2266.      --rfc'.  I just did and saw this:
  2267.  
  2268.           Mon, 25 Mar 1996 23:34:17 -0600
  2269.  
  2270. 
  2271. File: sh-utils.info,  Node: uname invocation,  Next: hostname invocation,  Prev: date invocation,  Up: System context
  2272.  
  2273. `uname': Print system information
  2274. =================================
  2275.  
  2276.    `uname' prints information about the machine and operating system it
  2277. is run on.  If no options are given, `uname' acts as if the `-s' option
  2278. were given. Synopsis:
  2279.  
  2280.      uname [OPTION]...
  2281.  
  2282.    If multiple options or `-a' are given, the selected information is
  2283. printed in this order:
  2284.  
  2285.      SYSNAME NODENAME RELEASE OSVERSION MACHINE
  2286.  
  2287.    The OSVERSION, at least, may well be multiple words.  For example:
  2288.  
  2289.      uname -a
  2290.      => Linux hayley 1.0.4 #3 Thu May 12 18:06:34 1994 i486
  2291.  
  2292.    The program accepts the following options.  Also see *Note Common
  2293. options::.
  2294.  
  2295. `-a'
  2296. `--all'
  2297.      Print all of the below information.
  2298.  
  2299. `-m'
  2300. `--machine'
  2301.      Print the machine (hardware) type.
  2302.  
  2303. `-n'
  2304. `--nodename'
  2305.      Print the machine's network node hostname.
  2306.  
  2307. `-p'
  2308. `--processor'
  2309.      Print the machine's processor type
  2310.  
  2311. `-r'
  2312. `--release'
  2313.      Print the operating system release.
  2314.  
  2315. `-s'
  2316. `--sysname'
  2317.      Print the operating system name.
  2318.  
  2319. `-v'
  2320.      Print the operating system version.
  2321.  
  2322. 
  2323. File: sh-utils.info,  Node: hostname invocation,  Prev: uname invocation,  Up: System context
  2324.  
  2325. `hostname': Print or set system name
  2326. ====================================
  2327.  
  2328.    With no arguments, `hostname' prints the name of the current host
  2329. system.  With one argument, it sets the current host name to the
  2330. specified string.  You must have appropriate privileges to set the host
  2331. name. Synopsis:
  2332.  
  2333.      hostname [NAME]
  2334.  
  2335.    The only options are `--help' and `--version'.  *Note Common
  2336. options::.
  2337.  
  2338. 
  2339. File: sh-utils.info,  Node: Modified command invocation,  Next: Delaying,  Prev: System context,  Up: Top
  2340.  
  2341. Modified command invocation
  2342. ***************************
  2343.  
  2344.    This section describes commands that run other commands in some
  2345. context different than the current one: a modified environment, as a
  2346. different user, etc.
  2347.  
  2348. * Menu:
  2349.  
  2350. * chroot invocation::           Modify the root directory.
  2351. * env invocation::              Modify environment variables.
  2352. * nice invocation::             Modify scheduling priority.
  2353. * nohup invocation::            Immunize to hangups.
  2354. * su invocation::               Modify user and group id.
  2355.  
  2356. 
  2357. File: sh-utils.info,  Node: chroot invocation,  Next: env invocation,  Up: Modified command invocation
  2358.  
  2359. `chroot': Run a command with a different root directory
  2360. =======================================================
  2361.  
  2362.    `chroot' runs a command with a specified root directory.  On many
  2363. systems, only the super-user can do this.  Synopses:
  2364.  
  2365.      chroot NEWROOT [COMMAND [ARGS]...]
  2366.      chroot OPTION
  2367.  
  2368.    Ordinarily, filenames are looked up starting at the root of the
  2369. directory structure, i.e., `/'.  `chroot' changes the root to the
  2370. directory NEWROOT (which must exist) and then runs COMMAND with
  2371. optional ARGS.  If COMMAND is not specified, the default is the value
  2372. of the `SHELL' environment variable or `/bin/sh' if not set, invoked
  2373. with the `-i' option.
  2374.  
  2375.    The only options are `--help' and `--version'.  *Note Common
  2376. options::.
  2377.  
  2378. 
  2379. File: sh-utils.info,  Node: env invocation,  Next: nice invocation,  Prev: chroot invocation,  Up: Modified command invocation
  2380.  
  2381. `env': Run a command in a modified environment
  2382. ==============================================
  2383.  
  2384.    `env' runs a command with a modified environment.  Synopses:
  2385.  
  2386.      env [OPTION]... [NAME=VALUE]... [COMMAND [ARGS]...]
  2387.      env
  2388.  
  2389.    Arguments of the form `VARIABLE=VALUE' set the environment variable
  2390. VARIABLE to value VALUE.  VALUE may be empty (`VARIABLE=').  Setting a
  2391. variable to an empty value is different from unsetting it.
  2392.  
  2393.    The first remaining argument specifies the program name to invoke;
  2394. it is searched for according to the `PATH' environment variable.  Any
  2395. remaining arguments are passed as arguments to that program.
  2396.  
  2397.    If no command name is specified following the environment
  2398. specifications, the resulting environment is printed.  This is like
  2399. specifying a command name of `printenv'.
  2400.  
  2401.    The program accepts the following options.  Also see *Note Common
  2402. options::.
  2403.  
  2404. `-u NAME'
  2405. `--unset=NAME'
  2406.      Remove variable NAME from the environment, if it was in the
  2407.      environment.
  2408.  
  2409. `-'
  2410. `-i'
  2411. `--ignore-environment'
  2412.      Start with an empty environment, ignoring the inherited
  2413.      environment.
  2414.  
  2415. 
  2416. File: sh-utils.info,  Node: nice invocation,  Next: nohup invocation,  Prev: env invocation,  Up: Modified command invocation
  2417.  
  2418. `nice': Run a command with modified scheduling priority
  2419. =======================================================
  2420.  
  2421.    `nice' prints or modifies the scheduling priority of a job.
  2422. Synopsis:
  2423.  
  2424.      nice [OPTION]... [COMMAND [ARG]...]
  2425.  
  2426.    If no arguments are given, `nice' prints the current scheduling
  2427. priority, which it inherited.  Otherwise, `nice' runs the given COMMAND
  2428. with its scheduling priority adjusted.  If no ADJUSTMENT is given, the
  2429. priority of the command is incremented by 10.  You must have
  2430. appropriate privileges to specify a negative adjustment.  The priority
  2431. can be adjusted by `nice' over the range of -20 (the highest priority)
  2432. to 19 (the lowest).
  2433.  
  2434.    Because most shells have a built-in command by the same name, using
  2435. the unadorned command name in a script or interactively may get you
  2436. different functionality than that described here.
  2437.  
  2438.    The program accepts the following option.  Also see *Note Common
  2439. options::.
  2440.  
  2441. `-n ADJUSTMENT'
  2442. `-ADJUSTMENT'
  2443. `--adjustment=ADJUSTMENT'
  2444.      Add ADJUSTMENT instead of 10 to the command's priority.
  2445.  
  2446. 
  2447. File: sh-utils.info,  Node: nohup invocation,  Next: su invocation,  Prev: nice invocation,  Up: Modified command invocation
  2448.  
  2449. `nohup': Run a command immune to hangups
  2450. ========================================
  2451.  
  2452.    `nohup' runs the given COMMAND with hangup signals ignored, so that
  2453. the command can continue running in the background after you log out.
  2454. Synopsis:
  2455.  
  2456.      nohup COMMAND [ARG]...
  2457.  
  2458.    `nohup' increases the scheduling priority of COMMAND by 5, so it has
  2459. a slightly smaller change to run.  If standard output is a terminal, it
  2460. and standard error are redirected so that they are appended to the file
  2461. `nohup.out'; if that cannot be written to, they are appended to the
  2462. file `$HOME/nohup.out'.  If that cannot be written to, the command is
  2463. not run.
  2464.  
  2465.    If `nohup' creates either `nohup.out' or `$HOME/nohup.out', it
  2466. creates it with no "group" or "other" access permissions.  It does not
  2467. change the permissions if the output file already existed.
  2468.  
  2469.    `nohup' does not automatically put the command it runs in the
  2470. background; you must do that explicitly, by ending the command line
  2471. with an `&'.
  2472.  
  2473.    The only options are `--help' and `--version'.  *Note Common
  2474. options::.
  2475.  
  2476. 
  2477. File: sh-utils.info,  Node: su invocation,  Prev: nohup invocation,  Up: Modified command invocation
  2478.  
  2479. `su': Run a command with substitute user and group id
  2480. =====================================================
  2481.  
  2482.    `su' allows one user to temporarily become another user.  It runs a
  2483. command (often an interactive shell) with the real and effective user
  2484. id, group id, and supplemental groups of a given USER. Synopsis:
  2485.  
  2486.      su [OPTION]... [USER [ARG]...]
  2487.  
  2488.    If no USER is given, the default is `root', the super-user.  The
  2489. shell to use is taken from USER's `passwd' entry, or `/bin/sh' if none
  2490. is specified there.  If USER has a password, `su' prompts for the
  2491. password unless run by a user with effective user id of zero (the
  2492. super-user).
  2493.  
  2494.    By default, `su' does not change the current directory.  It sets the
  2495. environment variables `HOME' and `SHELL' from the password entry for
  2496. USER, and if USER is not the super-user, sets `USER' and `LOGNAME' to
  2497. USER.  By default, the shell is not a login shell.
  2498.  
  2499.    Any additional ARGs are passed as additional arguments to the shell.
  2500.  
  2501.    GNU `su' does not treat `/bin/sh' or any other shells specially
  2502. (e.g., by setting `argv[0]' to `-su', passing `-c' only to certain
  2503. shells, etc.).
  2504.  
  2505.    `su' can optionally be compiled to use `syslog' to report failed,
  2506. and optionally successful, `su' attempts.  (If the system supports
  2507. `syslog'.)  However, GNU `su' does not check if the user is a member of
  2508. the `wheel' group; see below.
  2509.  
  2510.    The program accepts the following options.  Also see *Note Common
  2511. options::.
  2512.  
  2513. `-c COMMAND'
  2514. `--command=COMMAND'
  2515.      Pass COMMAND, a single command line to run, to the shell with a
  2516.      `-c' option instead of starting an interactive shell.
  2517.  
  2518. `-f'
  2519. `--fast'
  2520.      Pass the `-f' option to the shell.  This probably only makes sense
  2521.      if the shell run is `csh' or `tcsh', for which the `-f' option
  2522.      prevents reading the startup file (`.cshrc').  With Bourne-like
  2523.      shells, the `-f' option disables file name pattern expansion
  2524.      (globbing), which is not likely to be useful.
  2525.  
  2526. `-'
  2527. `-l'
  2528. `--login'
  2529.      Make the shell a login shell.  This means the following.  Unset all
  2530.      environment variables except `TERM', `HOME', and `SHELL' (which
  2531.      are set as described above), and `USER' and `LOGNAME' (which are
  2532.      set, even for the super-user, as described above), and set `PATH'
  2533.      to a compiled-in default value.  Change to USER's home directory.
  2534.      Prepend `-' to the shell's name, intended to make it read its
  2535.      login startup file(s).
  2536.  
  2537. `-m'
  2538. `-p'
  2539. `--preserve-environment'
  2540.      Do not change the environment variables `HOME', `USER', `LOGNAME',
  2541.      or `SHELL'.  Run the shell given in the environment variable
  2542.      `SHELL' instead of the shell from USER's passwd entry, unless the
  2543.      user running `su' is not the superuser and USER's shell is
  2544.      restricted.  A "restricted shell" is one that is not listed in the
  2545.      file `/etc/shells', or in a compiled-in list if that file does not
  2546.      exist.  Parts of what this option does can be overridden by
  2547.      `--login' and `--shell'.
  2548.  
  2549. `-s SHELL'
  2550. `--shell=SHELL'
  2551.      Run SHELL instead of the shell from USER's passwd entry, unless
  2552.      the user running `su' is not the superuser and USER's shell is
  2553.      restricted (see `-m' just above).
  2554.  
  2555. Why GNU `su' does not support the `wheel' group
  2556. ===============================================
  2557.  
  2558.    (This section is by Richard Stallman.)
  2559.  
  2560.    Sometimes a few of the users try to hold total power over all the
  2561. rest.  For example, in 1984, a few users at the MIT AI lab decided to
  2562. seize power by changing the operator password on the Twenex system and
  2563. keeping it secret from everyone else.  (I was able to thwart this coup
  2564. and give power back to the users by patching the kernel, but I wouldn't
  2565. know how to do that in Unix.)
  2566.  
  2567.    However, occasionally the rulers do tell someone.  Under the usual
  2568. `su' mechanism, once someone learns the root password who sympathizes
  2569. with the ordinary users, he or she can tell the rest.  The "wheel
  2570. group" feature would make this impossible, and thus cement the power of
  2571. the rulers.
  2572.  
  2573.    I'm on the side of the masses, not that of the rulers.  If you are
  2574. used to supporting the bosses and sysadmins in whatever they do, you
  2575. might find this idea strange at first.
  2576.  
  2577. 
  2578. File: sh-utils.info,  Node: Delaying,  Next: Numeric operations,  Prev: Modified command invocation,  Up: Top
  2579.  
  2580. Delaying
  2581. ********
  2582.  
  2583. * Menu:
  2584.  
  2585. * sleep invocation::            Delay for a specified time.
  2586.  
  2587. 
  2588. File: sh-utils.info,  Node: sleep invocation,  Up: Delaying
  2589.  
  2590. `sleep': Delay for a specified time
  2591. ===================================
  2592.  
  2593.    `sleep' pauses for an amount of time specified by the sum of the
  2594. values of the command line arguments.  Synopsis:
  2595.  
  2596.      sleep [NUMBER[smhd]]...
  2597.  
  2598.    Each argument is a number followed by an optional unit; the default
  2599. is seconds.  The units are:
  2600.  
  2601. `s'
  2602.      seconds
  2603.  
  2604. `m'
  2605.      minutes
  2606.  
  2607. `h'
  2608.      hours
  2609.  
  2610. `d'
  2611.      days
  2612.  
  2613.    The only options are `--help' and `--version'.  *Note Common
  2614. options::.
  2615.  
  2616. 
  2617. File: sh-utils.info,  Node: Numeric operations,  Next: Index,  Prev: Delaying,  Up: Top
  2618.  
  2619. Numeric operations
  2620. ******************
  2621.  
  2622.    These programs do numerically-related operations.
  2623.  
  2624. * Menu:
  2625.  
  2626. * factor invocation::              Show factors of numbers.
  2627. * seq invocation::                 Print sequences of numbers.
  2628.  
  2629. 
  2630. File: sh-utils.info,  Node: factor invocation,  Next: seq invocation,  Up: Numeric operations
  2631.  
  2632. `factor': Print prime factors
  2633. =============================
  2634.  
  2635.    `factor' prints prime factors.  Synopses:
  2636.  
  2637.      factor [NUMBER]...
  2638.      factor OPTION
  2639.  
  2640.    If no NUMBER is specified on the command line, `factor' reads
  2641. numbers from standard input, delimited by newlines, tabs, or spaces.
  2642.  
  2643.    The only options are `--help' and `--version'.  *Note Common
  2644. options::.
  2645.  
  2646. 
  2647. File: sh-utils.info,  Node: seq invocation,  Prev: factor invocation,  Up: Numeric operations
  2648.  
  2649. `seq': Print numeric sequences
  2650. ==============================
  2651.  
  2652.    `seq' prints a sequence of numbers to standard output.  Synopses:
  2653.  
  2654.      seq [OPTION]... [FIRST [STEP]] LAST...
  2655.  
  2656.    `seq' prints the numbers from FIRST to LAST by STEP.  By default,
  2657. FIRST and STEP are both 1, and each number is printed on its own line.
  2658. All numbers can be reals, not just integers.
  2659.  
  2660.    The program accepts the following options.  Also see *Note Common
  2661. options::.
  2662.  
  2663. `-f FORMAT'
  2664. `--format=FORMAT'
  2665.      Print all numbers using FORMAT; default `%g'.  FORMAT must contain
  2666.      exactly one of the standarding float output formats `%e', `%f', or
  2667.      `%g'.
  2668.  
  2669. `-s STRING'
  2670. `--separator=STRING'
  2671.      Separate numbers with STRING; default is a newline.  The output
  2672.      always terminates with a newline.
  2673.  
  2674. `-w'
  2675. `--equal-width'
  2676.      Print all numbers with the same width, by padding with leading
  2677.      zeroes.  (To have other kinds of padding, use `--format').
  2678.  
  2679. 
  2680. File: sh-utils.info,  Node: Index,  Prev: Numeric operations,  Up: Top
  2681.  
  2682. Index
  2683. *****
  2684.  
  2685. * Menu:
  2686.  
  2687. * !:                                     Connectives for test.
  2688. * !=:                                    String tests.
  2689. * %:                                     Numeric expressions.
  2690. * &:                                     Relations for expr.
  2691. * *:                                     Numeric expressions.
  2692. * +:                                     Numeric expressions.
  2693. * - <1>:                                 su invocation.
  2694. * - <2>:                                 env invocation.
  2695. * -:                                     Numeric expressions.
  2696. * -a <1>:                                uname invocation.
  2697. * -a <2>:                                stty invocation.
  2698. * -a <3>:                                tee invocation.
  2699. * -a:                                    Connectives for test.
  2700. * -ADJUSTMENT:                           nice invocation.
  2701. * -adjustment:                           nice invocation.
  2702. * -all <1>:                              uname invocation.
  2703. * -all:                                  stty invocation.
  2704. * -append:                               tee invocation.
  2705. * -b:                                    File type tests.
  2706. * -c <1>:                                su invocation.
  2707. * -c:                                    File type tests.
  2708. * -command:                              su invocation.
  2709. * -count:                                who invocation.
  2710. * -d <1>:                                Options for date.
  2711. * -d:                                    File type tests.
  2712. * -date:                                 Options for date.
  2713. * -e <1>:                                File characteristics tests.
  2714. * -e:                                    echo invocation.
  2715. * -ef:                                   File characteristics tests.
  2716. * -eq:                                   Numeric tests.
  2717. * -f <1>:                                su invocation.
  2718. * -f <2>:                                Options for date.
  2719. * -f:                                    File type tests.
  2720. * -f FORMAT:                             seq invocation.
  2721. * -fast:                                 su invocation.
  2722. * -file:                                 Options for date.
  2723. * -format=FORMAT:                        seq invocation.
  2724. * -G:                                    id invocation.
  2725. * -g <1>:                                id invocation.
  2726. * -g:                                    stty invocation.
  2727. * -G:                                    Access permission tests.
  2728. * -g:                                    Access permission tests.
  2729. * -ge:                                   Numeric tests.
  2730. * -group:                                id invocation.
  2731. * -groups:                               id invocation.
  2732. * -gt:                                   Numeric tests.
  2733. * -H:                                    who invocation.
  2734. * -h:                                    File type tests.
  2735. * -heading:                              who invocation.
  2736. * -help:                                 Common options.
  2737. * -i <1>:                                env invocation.
  2738. * -i <2>:                                who invocation.
  2739. * -i:                                    tee invocation.
  2740. * -idle:                                 who invocation.
  2741. * -ignore-environment:                   env invocation.
  2742. * -ignore-interrupts:                    tee invocation.
  2743. * -k:                                    Access permission tests.
  2744. * -l:                                    su invocation.
  2745. * -L:                                    File type tests.
  2746. * -le:                                   Numeric tests.
  2747. * -login:                                su invocation.
  2748. * -lt:                                   Numeric tests.
  2749. * -m <1>:                                su invocation.
  2750. * -m <2>:                                uname invocation.
  2751. * -m:                                    who invocation.
  2752. * -machine:                              uname invocation.
  2753. * -mesg:                                 who invocation.
  2754. * -message:                              who invocation.
  2755. * -n <1>:                                nice invocation.
  2756. * -n <2>:                                uname invocation.
  2757. * -n <3>:                                id invocation.
  2758. * -n <4>:                                String tests.
  2759. * -n:                                    echo invocation.
  2760. * -name:                                 id invocation.
  2761. * -ne:                                   Numeric tests.
  2762. * -nodename:                             uname invocation.
  2763. * -nt:                                   File characteristics tests.
  2764. * -o:                                    Connectives for test.
  2765. * -O:                                    Access permission tests.
  2766. * -ot:                                   File characteristics tests.
  2767. * -p <1>:                                su invocation.
  2768. * -p <2>:                                uname invocation.
  2769. * -p <3>:                                pathchk invocation.
  2770. * -p:                                    File type tests.
  2771. * -portability:                          pathchk invocation.
  2772. * -preserve-environment:                 su invocation.
  2773. * -processor:                            uname invocation.
  2774. * -q:                                    who invocation.
  2775. * -quiet:                                tty invocation.
  2776. * -r <1>:                                uname invocation.
  2777. * -r:                                    Options for date.
  2778. * -R:                                    Options for date.
  2779. * -r <1>:                                id invocation.
  2780. * -r:                                    Access permission tests.
  2781. * -real:                                 id invocation.
  2782. * -reference:                            Options for date.
  2783. * -release:                              uname invocation.
  2784. * -rfc-822:                              Options for date.
  2785. * -s <1>:                                su invocation.
  2786. * -s <2>:                                uname invocation.
  2787. * -s <3>:                                Options for date.
  2788. * -s <4>:                                who invocation.
  2789. * -s <5>:                                tty invocation.
  2790. * -s:                                    File characteristics tests.
  2791. * -S:                                    File type tests.
  2792. * -save:                                 stty invocation.
  2793. * -set:                                  Options for date.
  2794. * -shell:                                su invocation.
  2795. * -silent:                               tty invocation.
  2796. * -su:                                   su invocation.
  2797. * -sysname:                              uname invocation.
  2798. * -T:                                    who invocation.
  2799. * -t:                                    File type tests.
  2800. * -u <1>:                                env invocation.
  2801. * -u <2>:                                Options for date.
  2802. * -u <3>:                                who invocation.
  2803. * -u <4>:                                id invocation.
  2804. * -u:                                    Access permission tests.
  2805. * -universal:                            Options for date.
  2806. * -unset:                                env invocation.
  2807. * -user:                                 id invocation.
  2808. * -utc:                                  Options for date.
  2809. * -v:                                    uname invocation.
  2810. * -version:                              Common options.
  2811. * -w <1>:                                who invocation.
  2812. * -w:                                    Access permission tests.
  2813. * -writable:                             who invocation.
  2814. * -x:                                    Access permission tests.
  2815. * -z:                                    String tests.
  2816. * .cshrc:                                su invocation.
  2817. * /:                                     Numeric expressions.
  2818. * /bin/sh:                               su invocation.
  2819. * /etc/passwd:                           su invocation.
  2820. * /etc/shells:                           su invocation.
  2821. * /etc/utmp <1>:                         who invocation.
  2822. * /etc/utmp <2>:                         users invocation.
  2823. * /etc/utmp:                             logname invocation.
  2824. * /etc/wtmp <1>:                         who invocation.
  2825. * /etc/wtmp:                             users invocation.
  2826. * <:                                     Relations for expr.
  2827. * <=:                                    Relations for expr.
  2828. * = <1>:                                 Relations for expr.
  2829. * =:                                     String tests.
  2830. * ==:                                    Relations for expr.
  2831. * >:                                     Relations for expr.
  2832. * >=:                                    Relations for expr.
  2833. * \0ooo:                                 printf invocation.
  2834. * \0xhhh:                                printf invocation.
  2835. * \c:                                    printf invocation.
  2836. * abbreviations for months:              Calendar date item.
  2837. * access permission tests:               Access permission tests.
  2838. * addition:                              Numeric expressions.
  2839. * ago in date strings:                   Relative item in date strings.
  2840. * Alaska-Hawaii Time:                    Timezone item.
  2841. * am i:                                  who invocation.
  2842. * am in date strings:                    Time of day item.
  2843. * and operator <1>:                      Relations for expr.
  2844. * and operator:                          Connectives for test.
  2845. * appropriate privileges <1>:            nice invocation.
  2846. * appropriate privileges <2>:            hostname invocation.
  2847. * appropriate privileges:                Setting the time.
  2848. * arbitrary date strings, parsing:       Options for date.
  2849. * arbitrary text, displaying:            echo invocation.
  2850. * arithmetic tests:                      Numeric tests.
  2851. * Atlantic Standard Time:                Timezone item.
  2852. * authors of getdate:                    Authors of getdate.
  2853. * Azores Time:                           Timezone item.
  2854. * background jobs, stopping at terminal write: Local.
  2855. * backslash escapes:                     echo invocation.
  2856. * Baghdad Time:                          Timezone item.
  2857. * basename:                              basename invocation.
  2858. * baud rate, setting:                    Special.
  2859. * beeping at input buffer full:          Input.
  2860. * beginning of time:                     Time directives.
  2861. * beginning of time, for Unix:           Date input formats.
  2862. * Bellovin, Steven M.:                   Authors of getdate.
  2863. * Berets, Jim:                           Authors of getdate.
  2864. * Berry, K.:                             Authors of getdate.
  2865. * Berry, Karl:                           Introduction.
  2866. * block special check:                   File type tests.
  2867. * breaks, cause interrupts:              Input.
  2868. * breaks, ignoring:                      Input.
  2869. * brkint:                                Input.
  2870. * bsN:                                   Output.
  2871. * bugs, reporting:                       Introduction.
  2872. * built-in shell commands, conflicts with <1>: nice invocation.
  2873. * built-in shell commands, conflicts with <2>: pwd invocation.
  2874. * built-in shell commands, conflicts with: test invocation.
  2875. * C-s/C-q flow control:                  Input.
  2876. * calendar date item:                    Calendar date item.
  2877. * case translation:                      Local.
  2878. * case, ignored in dates:                General date syntax.
  2879. * cbreak:                                Combination.
  2880. * Central Alaska Time:                   Timezone item.
  2881. * Central European Time:                 Timezone item.
  2882. * Central Standard Time:                 Timezone item.
  2883. * change or print terminal settings:     stty invocation.
  2884. * character size:                        Control.
  2885. * character special check:               File type tests.
  2886. * characters, special:                   Characters.
  2887. * check file types:                      test invocation.
  2888. * China Coast Time:                      Timezone item.
  2889. * chroot:                                chroot invocation.
  2890. * clocal:                                Control.
  2891. * cols:                                  Special.
  2892. * COLUMNS:                               Special.
  2893. * columns:                               Special.
  2894. * combination settings:                  Combination.
  2895. * commands for delaying:                 Delaying.
  2896. * commands for exit status:              Conditions.
  2897. * commands for file name manipulation:   File name manipulation.
  2898. * commands for invoking other commands:  Modified command invocation.
  2899. * commands for printing text:            Printing text.
  2900. * commands for printing the working context: Working context.
  2901. * commands for printing user information: User information.
  2902. * commands for redirection:              Redirection.
  2903. * commands for system context:           System context.
  2904. * comments, in dates:                    General date syntax.
  2905. * common options:                        Common options.
  2906. * compare values:                        test invocation.
  2907. * comparison operators:                  Relations for expr.
  2908. * conditions:                            Conditions.
  2909. * conflicts with shell built-ins <1>:    nice invocation.
  2910. * conflicts with shell built-ins <2>:    pwd invocation.
  2911. * conflicts with shell built-ins:        test invocation.
  2912. * connectives, logical <1>:              Relations for expr.
  2913. * connectives, logical:                  Connectives for test.
  2914. * context, system:                       System context.
  2915. * control characters, using ^C:          Local.
  2916. * control settings:                      Control.
  2917. * cooked:                                Combination.
  2918. * coordinated universal time:            Options for date.
  2919. * cread:                                 Control.
  2920. * crN:                                   Output.
  2921. * crt:                                   Combination.
  2922. * crterase:                              Local.
  2923. * crtkill:                               Local.
  2924. * crtscts:                               Control.
  2925. * csN:                                   Control.
  2926. * cstopb:                                Control.
  2927. * ctlecho:                               Local.
  2928. * current working directory, printing:   pwd invocation.
  2929. * date:                                  date invocation.
  2930. * date directives:                       Date directives.
  2931. * date format, ISO 8601:                 Calendar date item.
  2932. * date input formats:                    Date input formats.
  2933. * date options:                          Options for date.
  2934. * date strings, parsing:                 Options for date.
  2935. * day in date strings:                   Relative item in date strings.
  2936. * day of week item:                      Day of week item.
  2937. * daylight savings time:                 Timezone item.
  2938. * dec:                                   Combination.
  2939. * decctlq:                               Combination.
  2940. * delay for a specified time:            sleep invocation.
  2941. * delaying commands:                     Delaying.
  2942. * destinations, multiple output:         tee invocation.
  2943. * directives, date:                      Date directives.
  2944. * directives, literal:                   Literal directives.
  2945. * directives, time:                      Time directives.
  2946. * directory check:                       File type tests.
  2947. * directory components, printing:        dirname invocation.
  2948. * directory, stripping from file names:  basename invocation.
  2949. * dirname:                               dirname invocation.
  2950. * disabling special characters:          Characters.
  2951. * displacement of dates:                 Relative item in date strings.
  2952. * displaying text:                       echo invocation.
  2953. * division:                              Numeric expressions.
  2954. * do nothing, successfully:              true invocation.
  2955. * dsusp:                                 Characters.
  2956. * East Australian Standard Time:         Timezone item.
  2957. * Eastern European Time:                 Timezone item.
  2958. * Eastern Standard Time:                 Timezone item.
  2959. * echo <1>:                              Local.
  2960. * echo:                                  echo invocation.
  2961. * echoctl:                               Local.
  2962. * echoe:                                 Local.
  2963. * echok:                                 Local.
  2964. * echoke:                                Local.
  2965. * echonl:                                Local.
  2966. * echoprt:                               Local.
  2967. * effective uid and gid, printing:       id invocation.
  2968. * effective UID, printing:               whoami invocation.
  2969. * eight-bit characters <1>:              Combination.
  2970. * eight-bit characters:                  Control.
  2971. * eight-bit input:                       Input.
  2972. * ek:                                    Combination.
  2973. * env:                                   env invocation.
  2974. * environment variables, printing:       printenv invocation.
  2975. * environment, preserving:               su invocation.
  2976. * environment, printing:                 env invocation.
  2977. * environment, running a program in a modified: env invocation.
  2978. * eof:                                   Characters.
  2979. * eol:                                   Characters.
  2980. * eol2:                                  Characters.
  2981. * epoch, for Unix:                       Date input formats.
  2982. * epoch, seconds since:                  Time directives.
  2983. * equal string check:                    String tests.
  2984. * erase:                                 Characters.
  2985. * evaluation of expressions:             expr invocation.
  2986. * even parity:                           Control.
  2987. * evenp:                                 Combination.
  2988. * examples of date:                      Examples of date.
  2989. * examples of expr:                      Examples of expr.
  2990. * executable file check:                 Access permission tests.
  2991. * existence-of-file check:               File characteristics tests.
  2992. * exit status commands:                  Conditions.
  2993. * exit status of expr:                   expr invocation.
  2994. * exit status of pathchk:                pathchk invocation.
  2995. * exit status of printenv:               printenv invocation.
  2996. * exit status of true <1>:               true invocation.
  2997. * exit status of true:                   false invocation.
  2998. * exit status of tty:                    tty invocation.
  2999. * expr:                                  expr invocation.
  3000. * expression evaluation <1>:             expr invocation.
  3001. * expression evaluation:                 test invocation.
  3002. * expressions, numeric:                  Numeric expressions.
  3003. * expressions, string:                   String expressions.
  3004. * factor:                                factor invocation.
  3005. * failure exit status:                   false invocation.
  3006. * false:                                 false invocation.
  3007. * fascism:                               su invocation.
  3008. * ffN:                                   Output.
  3009. * fields, padding numeric:               Padding.
  3010. * file characteristics tests:            File characteristics tests.
  3011. * file name manipulation:                File name manipulation.
  3012. * file name pattern expansion, disabled: su invocation.
  3013. * file names, checking validity and portability: pathchk invocation.
  3014. * file names, stripping directory and suffix: basename invocation.
  3015. * file type tests:                       File type tests.
  3016. * first in date strings:                 General date syntax.
  3017. * flow control, hardware:                Control.
  3018. * flow control, software:                Input.
  3019. * flushing, disabling:                   Local.
  3020. * formatting of numbers in seq:          seq invocation.
  3021. * formatting times:                      date invocation.
  3022. * fortnight in date strings:             Relative item in date strings.
  3023. * French Winter Time:                    Timezone item.
  3024. * general date syntax:                   General date syntax.
  3025. * getdate:                               Date input formats.
  3026. * globbing, disabled:                    su invocation.
  3027. * Greenwich Mean Time <1>:               Options for date.
  3028. * Greenwich Mean Time:                   Timezone item.
  3029. * group wheel, not supported:            su invocation.
  3030. * groups:                                groups invocation.
  3031. * Guam Standard Time:                    Timezone item.
  3032. * hangups, immunity to:                  nohup invocation.
  3033. * hard link check:                       File characteristics tests.
  3034. * hardware flow control:                 Control.
  3035. * hardware type:                         uname invocation.
  3036. * hat notation for control characters:   Local.
  3037. * Hawaii Standard Time:                  Timezone item.
  3038. * help, online:                          Common options.
  3039. * history:                               Introduction.
  3040. * HOME:                                  su invocation.
  3041. * host processor type:                   uname invocation.
  3042. * hostname <1>:                          hostname invocation.
  3043. * hostname:                              uname invocation.
  3044. * hour in date strings:                  Relative item in date strings.
  3045. * hup[cl]:                               Control.
  3046. * icanon:                                Local.
  3047. * icrnl:                                 Input.
  3048. * id:                                    id invocation.
  3049. * idle time:                             who invocation.
  3050. * iexten:                                Local.
  3051. * ignbrk:                                Input.
  3052. * igncr:                                 Input.
  3053. * ignpar:                                Input.
  3054. * imaxbel:                               Input.
  3055. * immunity to hangups:                   nohup invocation.
  3056. * index:                                 String expressions.
  3057. * information, about current users:      who invocation.
  3058. * inlcr:                                 Input.
  3059. * inpck:                                 Input.
  3060. * input settings:                        Input.
  3061. * International Date Line East:          Timezone item.
  3062. * International Date Line West:          Timezone item.
  3063. * intr:                                  Characters.
  3064. * introduction:                          Introduction.
  3065. * invocation of commands, modified:      Modified command invocation.
  3066. * isig:                                  Local.
  3067. * ISO 8601 date format:                  Calendar date item.
  3068. * ispeed:                                Special.
  3069. * istrip:                                Input.
  3070. * items in date strings:                 General date syntax.
  3071. * iuclc:                                 Input.
  3072. * ixany:                                 Input.
  3073. * ixoff:                                 Input.
  3074. * ixon:                                  Input.
  3075. * Japan Standard Time:                   Timezone item.
  3076. * kill:                                  Characters.
  3077. * last DAY <1>:                          Options for date.
  3078. * last DAY:                              Day of week item.
  3079. * last in date strings:                  General date syntax.
  3080. * LCASE:                                 Combination.
  3081. * lcase:                                 Combination.
  3082. * leading directory components, stripping: basename invocation.
  3083. * length:                                String expressions.
  3084. * line:                                  Special.
  3085. * line settings of terminal:             stty invocation.
  3086. * LINES:                                 Special.
  3087. * literal directives:                    Literal directives.
  3088. * litout:                                Combination.
  3089. * lnext:                                 Characters.
  3090. * local settings:                        Local.
  3091. * logging out and continuing to run:     nohup invocation.
  3092. * logical and operator <1>:              Relations for expr.
  3093. * logical and operator:                  Connectives for test.
  3094. * logical connectives <1>:               Relations for expr.
  3095. * logical connectives:                   Connectives for test.
  3096. * logical or operator <1>:               Relations for expr.
  3097. * logical or operator:                   Connectives for test.
  3098. * login name, printing:                  logname invocation.
  3099. * login sessions, printing users with:   users invocation.
  3100. * login shell:                           su invocation.
  3101. * login shell, creating:                 su invocation.
  3102. * login time:                            who invocation.
  3103. * LOGNAME:                               su invocation.
  3104. * logname:                               logname invocation.
  3105. * lowercase, translating to output:      Output.
  3106. * machine type:                          uname invocation.
  3107. * machine-readable stty output:          stty invocation.
  3108. * MacKenzie, David <1>:                  Authors of getdate.
  3109. * MacKenzie, David:                      Introduction.
  3110. * manipulation of file names:            File name manipulation.
  3111. * match:                                 String expressions.
  3112. * matching patterns:                     String expressions.
  3113. * message status:                        who invocation.
  3114. * Meyering, Jim <1>:                     Authors of getdate.
  3115. * Meyering, Jim:                         Introduction.
  3116. * Middle European Time:                  Timezone item.
  3117. * Middle European Winter Time:           Timezone item.
  3118. * midnight in date strings:              Time of day item.
  3119. * min:                                   Special.
  3120. * minute in date strings:                Relative item in date strings.
  3121. * minutes, timezone correction by:       Time of day item.
  3122. * MIT AI lab:                            su invocation.
  3123. * modem control:                         Control.
  3124. * modified command invocation:           Modified command invocation.
  3125. * modified environment, running a program in a: env invocation.
  3126. * modifying scheduling priority:         nice invocation.
  3127. * month in date strings:                 Relative item in date strings.
  3128. * month names in date strings:           Calendar date item.
  3129. * months, written-out:                   General date syntax.
  3130. * Mountain Standard Time:                Timezone item.
  3131. * multiplication:                        Numeric expressions.
  3132. * name of operating system:              uname invocation.
  3133. * named pipe check:                      File type tests.
  3134. * network node name:                     uname invocation.
  3135. * New Zealand Standard Time:             Timezone item.
  3136. * newer-than file check:                 File characteristics tests.
  3137. * newline echoing after kill:            Local.
  3138. * newline, echoing:                      Local.
  3139. * newline, translating to crlf:          Output.
  3140. * newline, translating to return:        Input.
  3141. * next DAY <1>:                          Options for date.
  3142. * next DAY:                              Day of week item.
  3143. * next in date strings:                  General date syntax.
  3144. * nice:                                  nice invocation.
  3145. * nl:                                    Combination.
  3146. * nlN:                                   Output.
  3147. * no-op:                                 true invocation.
  3148. * node name:                             uname invocation.
  3149. * noflsh:                                Local.
  3150. * nohup:                                 nohup invocation.
  3151. * nohup.out:                             nohup invocation.
  3152. * Nome Standard Time:                    Timezone item.
  3153. * non-directory suffix, stripping:       dirname invocation.
  3154. * nonempty file check:                   File characteristics tests.
  3155. * nonzero-length string check:           String tests.
  3156. * noon in date strings:                  Time of day item.
  3157. * not-equal string check:                String tests.
  3158. * now in date strings:                   Relative item in date strings.
  3159. * numbers, written-out:                  General date syntax.
  3160. * numeric expressions:                   Numeric expressions.
  3161. * numeric field padding:                 Padding.
  3162. * numeric operations:                    Numeric operations.
  3163. * numeric sequences:                     seq invocation.
  3164. * numeric tests:                         Numeric tests.
  3165. * ocrnl:                                 Output.
  3166. * odd parity:                            Control.
  3167. * oddp:                                  Combination.
  3168. * ofdel:                                 Output.
  3169. * ofill:                                 Output.
  3170. * olcuc:                                 Output.
  3171. * older-than file check:                 File characteristics tests.
  3172. * onlcr:                                 Output.
  3173. * onlret:                                Output.
  3174. * onocr:                                 Output.
  3175. * operating system name:                 uname invocation.
  3176. * operating system release:              uname invocation.
  3177. * operating system version:              uname invocation.
  3178. * opost:                                 Output.
  3179. * options for date:                      Options for date.
  3180. * or operator <1>:                       Relations for expr.
  3181. * or operator:                           Connectives for test.
  3182. * ordinal numbers:                       General date syntax.
  3183. * ospeed:                                Special.
  3184. * output settings:                       Output.
  3185. * owned by effective gid check:          Access permission tests.
  3186. * owned by effective uid check:          Access permission tests.
  3187. * Pacific Standard Time:                 Timezone item.
  3188. * pad character:                         Output.
  3189. * pad instead of timing for delaying:    Output.
  3190. * padding of numeric fields:             Padding.
  3191. * parenb:                                Control.
  3192. * parentheses for grouping:              expr invocation.
  3193. * parity:                                Combination.
  3194. * parity errors, marking:                Input.
  3195. * parity, ignoring:                      Input.
  3196. * parmrk:                                Input.
  3197. * parodd:                                Control.
  3198. * parsing date strings:                  Options for date.
  3199. * pass8:                                 Combination.
  3200. * passwd entry, and su shell:            su invocation.
  3201. * PATH <1>:                              su invocation.
  3202. * PATH:                                  env invocation.
  3203. * pathchk:                               pathchk invocation.
  3204. * pattern matching:                      String expressions.
  3205. * permission tests:                      Access permission tests.
  3206. * Pinard, F.:                            Authors of getdate.
  3207. * Pinard, Franc,ois:                     Introduction.
  3208. * pipe fitting:                          tee invocation.
  3209. * pm in date strings:                    Time of day item.
  3210. * portable file names, checking for:     pathchk invocation.
  3211. * POSIX.2:                               Introduction.
  3212. * prime factors:                         factor invocation.
  3213. * print name of current directory:       pwd invocation.
  3214. * print system information:              uname invocation.
  3215. * print terminal file name:              tty invocation.
  3216. * printenv:                              printenv invocation.
  3217. * printf:                                printf invocation.
  3218. * printing all or some environment variables: printenv invocation.
  3219. * printing current user information:     who invocation.
  3220. * printing current usernames:            users invocation.
  3221. * printing groups a user is in:          groups invocation.
  3222. * printing real and effective uid and gid: id invocation.
  3223. * printing text:                         echo invocation.
  3224. * printing text, commands for:           Printing text.
  3225. * printing the current time:             date invocation.
  3226. * printing the effective UID:            whoami invocation.
  3227. * printing the hostname:                 hostname invocation.
  3228. * printing user's login name:            logname invocation.
  3229. * priority, modifying:                   nice invocation.
  3230. * prterase:                              Local.
  3231. * pure numbers in date strings:          Pure numbers in date strings.
  3232. * pwd:                                   pwd invocation.
  3233. * quit:                                  Characters.
  3234. * quote:                                 String expressions.
  3235. * raw:                                   Combination.
  3236. * read from stdin and write to stdout and files: tee invocation.
  3237. * readable file check:                   Access permission tests.
  3238. * real uid and gid, printing:            id invocation.
  3239. * redirection:                           Redirection.
  3240. * regular expression matching:           String expressions.
  3241. * regular file check:                    File type tests.
  3242. * relations, numeric or string:          Relations for expr.
  3243. * relative items in date strings:        Relative item in date strings.
  3244. * release of operating system:           uname invocation.
  3245. * remainder:                             Numeric expressions.
  3246. * remote hostname:                       who invocation.
  3247. * repeated output of a string:           yes invocation.
  3248. * restricted shell:                      su invocation.
  3249. * return, ignoring:                      Input.
  3250. * return, translating to newline <1>:    Output.
  3251. * return, translating to newline:        Input.
  3252. * root directory, running a program in a specified: chroot invocation.
  3253. * root, becoming:                        su invocation.
  3254. * rows:                                  Special.
  3255. * rprnt:                                 Characters.
  3256. * RTS/CTS flow control:                  Control.
  3257. * running a program in a modified environment: env invocation.
  3258. * running a program in a specified root directory: chroot invocation.
  3259. * Salz, Rich:                            Authors of getdate.
  3260. * same file check:                       File characteristics tests.
  3261. * sane:                                  Combination.
  3262. * scheduling priority, modifying:        nice invocation.
  3263. * seconds since the epoch:               Time directives.
  3264. * separator for numbers in seq:          seq invocation.
  3265. * seq:                                   seq invocation.
  3266. * sequence of numbers:                   seq invocation.
  3267. * set-group-id check:                    Access permission tests.
  3268. * set-user-id check:                     Access permission tests.
  3269. * setting the hostname:                  hostname invocation.
  3270. * setting the time:                      Setting the time.
  3271. * SHELL:                                 su invocation.
  3272. * shell utilities:                       Top.
  3273. * size:                                  Special.
  3274. * sleep:                                 sleep invocation.
  3275. * socket check:                          File type tests.
  3276. * software flow control:                 Input.
  3277. * special characters:                    Characters.
  3278. * special settings:                      Special.
  3279. * speed:                                 Special.
  3280. * Stallman, Richard:                     Introduction.
  3281. * start:                                 Characters.
  3282. * sticky bit check:                      Access permission tests.
  3283. * stop:                                  Characters.
  3284. * stop bits:                             Control.
  3285. * strftime and date:                     date invocation.
  3286. * string expressions:                    String expressions.
  3287. * string tests:                          String tests.
  3288. * strip directory and suffix from file names: basename invocation.
  3289. * stripping non-directory suffix:        dirname invocation.
  3290. * stty:                                  stty invocation.
  3291. * su:                                    su invocation.
  3292. * substitute user and group ids:         su invocation.
  3293. * substr:                                String expressions.
  3294. * subtraction:                           Numeric expressions.
  3295. * successful exit:                       true invocation.
  3296. * suffix, stripping from file names:     basename invocation.
  3297. * super-user, becoming:                  su invocation.
  3298. * supplementary groups, printing:        groups invocation.
  3299. * susp:                                  Characters.
  3300. * Swedish Winter Time:                   Timezone item.
  3301. * swtch:                                 Characters.
  3302. * symbolic link check:                   File type tests.
  3303. * symbolic links and pwd:                pwd invocation.
  3304. * syslog:                                su invocation.
  3305. * system context:                        System context.
  3306. * system information, printing:          uname invocation.
  3307. * system name, printing:                 hostname invocation.
  3308. * tabN:                                  Output.
  3309. * tabs:                                  Combination.
  3310. * tandem:                                Input.
  3311. * tee:                                   tee invocation.
  3312. * TERM:                                  su invocation.
  3313. * terminal check:                        File type tests.
  3314. * terminal file name, printing:          tty invocation.
  3315. * terminal lines, currently used:        who invocation.
  3316. * terminal settings:                     stty invocation.
  3317. * test:                                  test invocation.
  3318. * text, displaying:                      echo invocation.
  3319. * this in date strings:                  Relative item in date strings.
  3320. * time:                                  Special.
  3321. * time directives:                       Time directives.
  3322. * time formats:                          date invocation.
  3323. * time of day item:                      Time of day item.
  3324. * time setting:                          Setting the time.
  3325. * time units:                            sleep invocation.
  3326. * time, printing or setting:             date invocation.
  3327. * timezone correction:                   Time of day item.
  3328. * timezone item:                         Timezone item.
  3329. * today in date strings:                 Relative item in date strings.
  3330. * tomorrow:                              Options for date.
  3331. * tomorrow in date strings:              Relative item in date strings.
  3332. * tostop:                                Local.
  3333. * true:                                  true invocation.
  3334. * tty:                                   tty invocation.
  3335. * Twenex:                                su invocation.
  3336. * two-way parity:                        Control.
  3337. * u, and disabling special characters:   Characters.
  3338. * uname:                                 uname invocation.
  3339. * Universal Coordinated Time:            Timezone item.
  3340. * uppercase, translating to lowercase:   Input.
  3341. * USER:                                  su invocation.
  3342. * user id, switching:                    su invocation.
  3343. * user information, commands for:        User information.
  3344. * user name, printing:                   logname invocation.
  3345. * usernames, printing current:           users invocation.
  3346. * users:                                 users invocation.
  3347. * USSR Zone:                             Timezone item.
  3348. * utilities for shell programming:       Top.
  3349. * utmp:                                  logname invocation.
  3350. * valid file names, checking for:        pathchk invocation.
  3351. * version number, finding:               Common options.
  3352. * version of operating system:           uname invocation.
  3353. * vtN:                                   Output.
  3354. * week in date strings:                  Relative item in date strings.
  3355. * werase:                                Characters.
  3356. * West African Time:                     Timezone item.
  3357. * West Australian Standard Time:         Timezone item.
  3358. * Western European Time:                 Timezone item.
  3359. * wheel group, not supported:            su invocation.
  3360. * who:                                   who invocation.
  3361. * who am i:                              who invocation.
  3362. * whoami:                                whoami invocation.
  3363. * working context:                       Working context.
  3364. * working directory, printing:           pwd invocation.
  3365. * writable file check:                   Access permission tests.
  3366. * write, allowed:                        who invocation.
  3367. * xcase:                                 Local.
  3368. * XON/XOFF flow control:                 Input.
  3369. * year in date strings:                  Relative item in date strings.
  3370. * yes:                                   yes invocation.
  3371. * yesterday:                             Options for date.
  3372. * yesterday in date strings:             Relative item in date strings.
  3373. * Yukon Standard Time:                   Timezone item.
  3374. * zero-length string check:              String tests.
  3375. * |:                                     Relations for expr.
  3376.  
  3377.  
  3378. 
  3379. Tag Table:
  3380. Node: Top3347
  3381. Node: Introduction4267
  3382. Node: Common options6029
  3383. Node: Date input formats6746
  3384. Node: General date syntax9194
  3385. Node: Calendar date item10644
  3386. Node: Time of day item12598
  3387. Node: Timezone item14205
  3388. Node: Day of week item17458
  3389. Node: Relative item in date strings18441
  3390. Node: Pure numbers in date strings20371
  3391. Node: Authors of getdate21354
  3392. Node: Printing text22090
  3393. Node: echo invocation22468
  3394. Node: printf invocation23452
  3395. Node: yes invocation24471
  3396. Node: Conditions24932
  3397. Node: false invocation25519
  3398. Node: true invocation25952
  3399. Node: test invocation26462
  3400. Node: File type tests27602
  3401. Node: Access permission tests28391
  3402. Node: File characteristics tests29156
  3403. Node: String tests29823
  3404. Node: Numeric tests30404
  3405. Node: Connectives for test31188
  3406. Node: expr invocation31528
  3407. Node: Relations for expr32688
  3408. Node: Numeric expressions33382
  3409. Node: String expressions33980
  3410. Node: Examples of expr36153
  3411. Node: Redirection36775
  3412. Node: tee invocation37216
  3413. Node: File name manipulation38037
  3414. Node: basename invocation38481
  3415. Node: dirname invocation39030
  3416. Node: pathchk invocation39572
  3417. Node: Working context40777
  3418. Node: pwd invocation41417
  3419. Node: stty invocation42017
  3420. Node: Control43980
  3421. Node: Input44728
  3422. Node: Output46115
  3423. Node: Local47359
  3424. Node: Combination48926
  3425. Node: Characters51064
  3426. Node: Special52606
  3427. Node: printenv invocation53944
  3428. Node: tty invocation54699
  3429. Node: User information55396
  3430. Node: id invocation56044
  3431. Node: logname invocation57183
  3432. Node: whoami invocation57686
  3433. Node: groups invocation58080
  3434. Node: users invocation58712
  3435. Node: who invocation59518
  3436. Node: System context61295
  3437. Node: date invocation61718
  3438. Node: Time directives62891
  3439. Node: Date directives64041
  3440. Node: Literal directives65503
  3441. Node: Padding65778
  3442. Node: Setting the time66584
  3443. Node: Options for date67548
  3444. Node: Examples of date68982
  3445. Node: uname invocation70419
  3446. Node: hostname invocation71572
  3447. Node: Modified command invocation72065
  3448. Node: chroot invocation72691
  3449. Node: env invocation73528
  3450. Node: nice invocation74762
  3451. Node: nohup invocation75942
  3452. Node: su invocation77118
  3453. Node: Delaying81384
  3454. Node: sleep invocation81586
  3455. Node: Numeric operations82113
  3456. Node: factor invocation82430
  3457. Node: seq invocation82889
  3458. Node: Index83913
  3459. 
  3460. End Tag Table
  3461.